Friday, August 26, 2011

When a New Service Request is Created SR should be automatically assigned to Defalt queue Owner

Below code needs to be written in New Record Event.

function BusComp_NewRecord ()
{
    var srOwner = TheApplication().InvokeMethod("LookupValue","ATC_QUEUE_ASSIGNMENT", "Default Queue");
    this.ActivateField("Owner");
    var srOwnerPickList = this.GetPicklistBusComp("Owner");
    srOwnerPickList.SetViewMode(AllView);
    srOwnerPickList.ActivateField("Login Name");
    srOwnerPickList.ClearToQuery();
    srOwnerPickList.SetSearchSpec("Login Name", srOwner);
    srOwnerPickList.ExecuteQuery(ForwardOnly);       
    if (srOwnerPickList.FirstRecord())
        srOwnerPickList.Pick();
    srOwnerPickList = null;
    isNewCIRSR = "Y";
}

No comments:

Post a Comment