Preventing save and close of a meeting

Hi

I want to add a bit of code to the querysave of the _Calendar Entry form to check on a field value and prevent the save and close of the entry.

I can prevent the save, but the entry always closes if the user has clicked the ‘Save and Send Invitations’ action.

The action has the formula:

FIELD tmpAction := “6”;@If(@PostedCommand([FileSave]);

@PostedCommand([FileCloseWindow]); “”)

Which seems to me to say the if the save doesn’t happen, don’t close.

The code I’ve added to my querysave, before any of the normal code is:

If source.isnewdoc And source.FieldGetText(“LogUNID”) = “” And source.FieldGetText(“AppointmentType”) = “Meeting” Then

Dim ans As Integer

Dim w As New notesuiworkspace

ans = w.prompt(2, "Contact Log", "Are you sure you want to send without creating and contact log?")

If ans = 1 Then

	continue = False

	Exit Sub

End If

End If

The LogUNID field is a new one I’ve added to the form, which basically is a central store of logs of meetings with clients.

Anyone know how I can achieve what I’m attempting to do?

Thanks

Dan

Subject: Preventing save and close of a meeting

Change your @Postedcommands to @Commands instead.

/Peter

Subject: RE: Preventing save and close of a meeting

Thanks, this sort of works, but with a couple of issues.

One is that I don’t like changing formulae on the mail template (this formula is standard with the mail template). Do you know why they’re postedcommands in the first place, and what changing them might effect?

Second is that if I know say ‘Yes’ to the prompt it will stop the save and close, but then simply hitting escape closes the document without prompting to save at all. This might of course be the effect of changing the formula.

Any comments/ideas on these?