-1

I have an application engine and i'm trying to do a try catch for record.insert in peoplecode action

But it seems that if the insert encountered an error in between, the rows prior to the error were rollback and only the rows after the error were being committed

for &i = 1 to &rowset.activerowcount

try ... record.insert catch exception.. end-try..

end-for

row 1 - not inserted row 2 - not inserted row error row 3 - inserted row 4 - inserted

does try catch really behaves this way? Is there any way that row 1 and 2 will also be inserted into the database?

thanks

psoft_kid
  • 1
  • 2
  • 1
    please add a complete code example to describe your problem. btw it's not necessary to catch exception of a `&my_record.insert()`, simply evaluate the boolean result of this insert statement. – Frank Ockenfuss Dec 22 '15 at 07:28

1 Answers1

0

Try putting a commitwork() in the for loop.

CommitWork();  
Jared
  • 310
  • 1
  • 9