Bookshelf Home | Contents | Index | Search | PDF |
Siebel SmartScript Administration Guide > Extending Scripts with Siebel VB and Siebel eScript > Sample Siebel VB and Siebel eScript Methods >
Finding a Contact
The following Siebel VB and Siebel eScript code samples look for the current caller in the database.
Siebel VB Code
Sub Script_Open
Dim FirstQuestion as SmartScriptQuestion
Dim ContactBC as BusComp
Dim ContactId as String
Dim ContactExists as IntegerSet FirstQuestion = StartQuestion
Set ContactBC = FirstQuestion.GetSaveBusCompContactBC.ActivateField "Id "
ContactId = GetParameter("ContactId")If ContactId <> "" then
ContactBC.SetViewMode 3
ContactBC.SetSearchSpec "Id", ContactId
ContactBC.ExecuteQuery ForwardBackward
ContactExists = ContactBC.FirstRecord()If not ContactExists then
ContactBC.NewRecord NewBefore
end ifelse
ContactBC.NewRecord NewBefore
end if
End Sub
Siebel eScript Code
function Script_Open ()
{var FirstQuestion;
var ContactBC;
var ContactId;
var ContactExists;FirstQuestion = StartQuestion ();
ContactBC = FirstQuestion.GetSaveBusComp ();ContactBC.ActivateField ("Id");
ContactId = GetParameter ("ContactId");if (ContactId != "")
{ContactBC.SetViewMode (3);
ContactBC.SetSearchSpec ("Id", ContactId);
ContactBC.ExecuteQuery (ForwardBackward);
ContactExists = ContactBC.FirstRecord ();if (!ContactExists)
{
ContactBC.NewRecord (NewBefore);
}}
else
{ContactBC.NewRecord (NewBefore);
}
}
Bookshelf Home | Contents | Index | Search | PDF |
Siebel SmartScript Administration Guide Published: 23 June 2003 |