Siebel Tools >  SBL-DAT-00523: The selected record has been changed by another user since retrieval.

SBL-DAT-00523: The selected record has been changed by another user since retrieval.

Write Conflict in task - Table S_ADDR_PER, Id '1-DN2Q8', old Mod Id 2520, new Mod Id 2520


SBL-DAT-00523 error occurs while running the following eScript code:


bo = TheApplication().GetBusObject("Account");

bcA = bo.GetBusComp("Account");

bcA.SetViewMode(AllView);

bcA.ClearToQuery();

bcA.SetSearchSpec("Id", "AcId");

bcA.ExecuteQuery();


if(bcA.FirstRecord())

           {

               comAdd = bo.GetBusComp("CUT Address");

               comAdd.SetViewMode(AllView);

               comAdd.ClearToQuery();

               comAdd.SetSearchExpr("[Street Address] like ['Sharon*'] ");

               comAdd.ExecuteQuery();

               var AddrExist = comAdd.FirstRecord();

               while(AddrExist)

                       {

                            comAdd.SetFieldValue("Type", "Valid");

                            comAdd.WriteRecord();

                            comAdd.NextRecord();

                        }

                }

                  comAdd = null;

                  bcA = null;


This could be a problem as there could be many addresses and accounts that

we are working with.Oracle says that if the number of records fetched is over 10000,

it is quite likelythat another process could interefere and update records in

the resultset and show the SBL-DAT-00523 error message.


We need to do just a small adjustment in this script to avoid this error. The changes are

highlighted in blue.

 

              bo = TheApplication().GetBusObject("Account");

              bcA = bo.GetBusComp("Account");

              bcA.SetViewMode(AllView);

              bcA.ClearToQuery();

              bcA.SetSearchSpec("Id", "AcId");

              bcA.ExecuteQuery(ForwardOnly);

 
              if(bcA.FirstRecord())

               {

                      comAdd = bo.GetBusComp("CUT Address");

                      comAdd.SetViewMode(AllView);

                      comAdd.ClearToQuery();

                      comAdd.SetSearchExpr("[Street Address] like ['Sharon*'] ");

                      comAdd.ExecuteQuery(ForwardOnly);

                     var AddrExist = comAdd.FirstRecord();

                     while(AddrExist)

                     {

                          comAdd.SetFieldValue("Type", "Valid");

                          comAdd.WriteRecord();

                      }

                      comAdd.NextRecord();

               }   

               comAdd = null;

               bcA = null;

 

This error has happened in Versions 8.1.1.3 and 15.11 for me.