I have the following code in an action button:
@SetField(“SafetyMgr”; “”);
@SetField(“FormCo”; “”);
@SetField(“safetyMgrBU”; “”);
@SetField(“priorityEdits”; “”);
@SetField(“leadershipTeam”; “”);
newReaders := @PickList( [Name]);
existingReaders := (existingReaders : newReaders);
@SetField(“whoCanRead”; @Trim(@Unique(ResPerson : initiator : autManager : existingReaders)));
@SetField(“privateFlag”; 1);
@Prompt([Ok]; “Read Restrcitions Added”; “Read access to this document has now been restricted. Be sure to save document when you are finished editing.”)
It all works fine if the user adds names when the picklist is displayed, but if the user cancels the picklist, then the code just stops. I want the code to execute, but the allow the user to optionally select additional users if he chooses. So why does canceling the picklist cancel the whole process? Is there some way to rewrite this? I can’t just add a field to the form for this since this button will have restricted use.
Also, I tried adding some commands to save the document, close the document and then re-open the document in edit mode, but when I did that, Notes would display a message asking me if I wanted to save my changes. But why? I just saved and re-opened it. (I wanted to save and re-open so the user would see the formerly hidden fields he just updated.)I figured the reason was that I had code in the QuerySave event, but I checked and there was nothing there.