Difference between @SetField and uidoc.fieldSetText

The situation (notes 7.0.2):The form OutOfOfficeProfile in the mailtemplate contains a button “OK” with following formula-code:

FIELD SaveOptions:=SaveOptions;

@SetField(“SaveOptions”;“1”);

@If(

@Command([FileSave]);

	@Command([FileCloseWindow]);

@Return("")

)

I would like to add some more functionality (lotusscript) which I have defined in a new function in de Global Declarations of the OOO-form.

In order to be sure that the functions are performed in the correct following order (set saveoptions > FileSave > New script > FileCloseWindow) I want to rewrite this OK-button completely in lotusscript.

My problem: a can’t get my “SaveOptions” to work properly. No matter how (ui or backend) I define the setting of the field “SaveOptions”, the OutOfOfficeControl.Querysave method (also in the Global Declarations of the OOO-form) does not “see” my SaveOptions-setting.

What is the functional difference between “@SetField(“SaveOptions”;“1”)” and

Source.fieldsettext(“SaveOptions”,“1”) or Source.document.SaveOptions=“1”

By the way: The problem seems to be lying in the Dialogbox.

When opened as a normal form (from designer > preview OOO-form) my scriptcode works as a charm …

Any clue greatly appreciated!!

Arthur

Subject: Difference between @SetField and uidoc.fieldSetText …

Hello Tuur ,

Did you checked you dont have any code related to Saveoptions in the post Save event?

the difference between the Source.fieldsettext(“Saveoptions”;“1”) and the Source.document.Saveoptions = “1” is in the prior one the field is set using the frontend class where the physical existance of the field is requeired.in the later one the frontend document is accessed as a backend document , in this case you dont need to have a physicall existance of the field.if field doesnt exists it will create one and assigns the value.

Source.fieldsettext(“”,“”) [Lotus Script] == @setfield(“”;“”)

hope this clears you query.

Regards ,

Ravi K Daparthi

ravi.daparthi@gmail.com