Tuesday, 15 October 2019

Deleting Multiple Records in Siebel Script

Hello All,

Recently i had a requirement wherein i wanted to delete some records in Script.
Its very simple but i was missing a very basic thing.


while(FRecord)   

     FRecord = DeleteRecord();
    FRecord = NextRecord(); 
}                                                                                                               


This script deleted only the first record not subsequent record, reason was just after deleting the records the cursor was set to First Record so NextRecord was not fetching any results.
Final Script required me to call FirstRecord again after performing DeleteRecord.

Working Code:


with(ErrorBC)
{
   ActivateField("Error Object");
   ClearToQuery();
   SetViewMode(AllView);
   SetSearchSpec("Error Object", "Todays Failure");//Deallocate 0-D5B3
   ExecuteQuery(ForwardBackward);
   var FRecord=FirstRecord();
   while(FRecord)   

FRecord = DeleteRecord();
    //This did the trick. The Cursor would always be reset to First record and the deletion went fine.
      FRecord=FirstRecord();

}
}

1 comment:

Siebel GoTo View - Handling Realtime cases

 Hello All,  We all must have used GoTo view functionality of siebel to navigate to a particular view from current view. What if the require...