Tuesday 4 February 2014

DoSaveNow() saves and SetReEdit(True) nets the rebound

Recently I had a problem with DoSaveNow() not doing what it said on the tin and actually saving a component. Initially this was worked around by using CommitWork() instead, but ultimately this stopped working as well.

The solution was to use SetReEdit prior to doing the save. e.g.

SetReEdit(True);
DoSaveNow();

Set ReEdit switches re-edit mode on and off. When it is on, definitional edits (such as translate table and prompt table edits), as well as FieldEdit PeopleCode, are run on each editable field in the component when the component is saved.Whey the DoSaveNow failed to save without it and why it succeeded with it, I haven't got a Scooby's. But as it sorted out my save issue and stopped me swearing at the screen, I'm no complaining!

It only works.

1 comment:

Anonymous said...

Hello,

Its too late to reply but I found it lately and just wanted to know if in case there was anything that was really changed in the component before you tried saving it (when dosavenow() was issued).

Set reedit as far as I know would force to check translate and prompt table edits on all fields on component as though the entries were all new.

May be that was the reason due to which save events would not fire as no change would have been found in the component buffer.

Thanks
Priyanka