Action button formula

I have a “Submit Request” action button with the following formula that works great. What I would like to do is revise this so that the message says “Pressing Submit, will send the request for immediate review. Press Save to keep this request in draft status”. Can someone help me revise this formula? Thank you.

FIELD Status := Status;

FIELD Name_Approver := Name_Approver;

TypeReq := “Project”;

x := @GetProfileField(“AppProfile”; “ap_SendToSubmit”);

@If(@Command([FileSave]);

@Do(

	@SetField("Status"; "Submitted");

       FIELD SubmittedDate := @Today;

       FIELD Submitter := @Name([CN]; @UserName);

	@MailSend(x; @UserName:Name_Approver; ""; "New " + TypeReq + "  Request submitted "; ""; ""; [IncludeDoclink]);

	@Prompt([Ok]; "Request submitted"; "Request submitted for processing.");

	@PostedCommand([FileSave]);

	@PostedCommand([FileCloseWindow]));

@Return (“”))

Subject: Action button formula

This line is the one that pops up the message:@Prompt([Ok]; “Request submitted”; “Request submitted for processing.”);

Domino Designer Help will help explain the parameters, you should read it, but to help you out, you want:

@Prompt([Ok]; “Request submitted”; “Pressing Submit, will send the request for immediate review. Press Save to keep this request in draft status”);

Subject: RE: Action button formula

Thank you for your response. I understand where to change the message. I don’t think I was very clear on my question. I think I want to actually make the prompt YESNO. What I want to happen is if they choose Yes the document will be submitted, but if they choose No I want the document to stay in the Draft status as it is. But with my current formula it will submit whether I hit yes or no. Probably becuase of the line: FIELD Status := Status; Draft is not a choice for a status so I wasnt quite sure how to revise this.

Subject: RE: Action button formula

No, the problem is that you start a block of the code that includes the existing prompt with @SetField(“Status”; “Submitted”).

Your warning should go right at the top of the formula:

@If(@Prompt([YESNO]; “…blah…”; “…blah blah blah…”); “”; @Return(“”));

The “” is the formula language equivalent of “do nothing and carry on”. The @Return(“”) is “do nothing and stop here”. If the user answers Yes to your carefully-worded “are you sure that you want to submit this” question (and do take time with the wording – YESNO dialogs are probably the most confusing things users come across), then nothing else happens IN THAT LINE, and the rest of the formula runs. If they answer No, then the formula finishes right there without doing anything.

The @If(something; “”; @Return(“”)); – or @If(something; @Return(“”);“”); if that’s easier to write for the situation – construction is one of the handiest things to know in Formula Language. It will save you a lot of headaches and complexity. Just be careful where you’re asking the questions or doing the checks to make sure you’re not making any document changes (or taking other measures) you didn’t want to make first.

Subject: RE: Action button formula

Awesome! Thank you for your help and direction!!