In the Programs list, select Script_Finish, and add the following code:
NOTE: When assigning an object, it must exist in order to match the assignment rules, criteria, and so on. To make sure that a newly created record exists in the database, users can run the following event:
BusinessComponent.WriteRecord()
before calling an Assignment Manager method in the SmartScript event.
function Script_Finish()
{
var sFirstQuestion = StartQuestion();
var SaveBC = sFirstQuestion.GetSaveBusComp();
TheApplication().Trace(" \n the value of sFirstQuestion = "+sFirstQuestion);
SaveBC.ActivateField("Area");
SaveBC.SetFieldValue("Area", "Upgrade");
//*****************
var myid = SaveBC.GetFieldValue("Id");
SaveBC.WriteRecord();
var bsAmgr = TheApplication().GetService("Synchronous
Assignment Manager Requests");
var psInput = TheApplication().NewPropertySet();
var psOutput= TheApplication().NewPropertySet();
psInput.SetProperty("AsgnObjName","Service Request");
//Assignment Object Name
psInput.SetProperty("ObjRowId", myid); //Object Row ID
bsAmgr.InvokeMethod("Assign", psInput, psOutput);
//*****************
}