Why doesn't code continue after @Picklist?

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.

Subject: RE: Why doesn’t code continue after @Picklist?

Well, as is no doubt not a surprise, when the user cancels out of @Picklist it cancels out of the formula also.

You could address this by using LotusScript instead, which gives you greater control over when the code exits.

Subject: RE: Why doesn’t code continue after @Picklist?

could you not place a condition around the newreaders variable? that is:

value := (@prompt([yesnocancel]…“Do you wish to select a name or continue?”);

newreader := @if(value = 1; @picklist([name]); “”)

or some variation of this?

(assuming 0 and -1 are No and cancel respectively return from prompt)

just thinking “out loud”

Subject: Does not work. The Cancel button (for good or bad) Cancels the execution of the Formula.

Subject: RE: Does not work. The Cancel button (for good or bad) Cancels the execution of the Formula.

I was able to get what I want by switching to a dialogbox. If that wouldn’t have worked, I would have tried script next.

Subject: RE: Does not work. The Cancel button (for good or bad) Cancels the execution of the Formula.

just give them a yes or no button - use [nocancel] as a parameter to @prompt.

users always love that one - LOL!