Button formula problem

I’m still having a problem with this formula.When clicking ok, the document does not email and save. Also, do I need the @Prompt([Ok] in a different area for each @If plantlocation = ?

@Command([FileSave]);

subject:=“Complaint/New Document - Test Database”;

body:="A A new document has been entered into the Test Database. It requires your attention. Click on this link to view → ";

@If(plantlocation = “location1”;@MailSend(“diffew”:“erdsaw”:“polpol”;“”;

“complaintby”:“salesengineer”;“”;subject;“”;body;[IncludeDoclink]);

plantlocation = "location2";@MailSend("diffew":"erdsaw":"polpol";"";

“complaintby”:“salesengineer”;“”;subject;“”;body;[IncludeDoclink]);

plantlocation = "location3";@MailSend("diffew":"erdsaw":"polpol";"";

“complaintby”:“salesengineer”;“”;subject;“”;body;[IncludeDoclink]);

plantlocation = "location4";@MailSend("diddid":"asrkop":"tiyerf";"";

“complaintby”:“salesengineer”;“”;subject;“”;body;[IncludeDoclink]);

plantlocation = "location5";@MailSend("didid":"asrkop":"tiyerf";"";

“complaintby”:“salesengineer”;“”;subject;“”;body;[IncludeDoclink]);

plantlocation = "location6";@MailSend("didid":"asrkop:"tiyerf"";"";

“complaintby”:“salesengineer”;“”;subject;“”;body;[IncludeDoclink]);

plantlocation = "location7";@MailSend("didid":"asrkop":"tiyerf";"";

“complaintby”:“salesengineer”;“”;subject;“”;body;[IncludeDoclink]); “”);

list:=@Unique(“email1”:“email2”:"email3"“newdocby”:“salesengineer”);

@Prompt([Ok];@DbTitle;“Thank You! Your new document has been saved and mail notifications have been sent to: " + @Implode(list;”,") )

Subject: Check your punctuation

It looks like you have SendTo(multiples); No cc; BCC (multiples); No subject; First part of body; then no body; then an extra body.

I would suggest that your use only one mailsend. Use your formulas to set sendto, cc, and bcc. Then perform one mailsend. It looks cleaner and easier to read.

Subject: button formula problem

Unless you have people named “didid”, “complaintby” and so on, you probably should remove the quotation marks from the field and variable names. I can’t tell what else to do here – it can be cleaned up quite a bit, but I don’t know which items are field names and which are literal values.

Subject: RE: button formula problem

This is my thinking here…

If the plantlocation = “certainfield”, send mail to user → didid, asrkop, tiyerf, then copy the result of field complaintby and copy the sales engineer.

When you click on the box, a pop up a box will say the document has been saved and show the users that are getting the emails.

Any suggestions on cleaning this up?

plantlocation = “location6”;@MailSend(“didid”:“asrkop:“tiyerf””;“”;

“complaintby”:“salesengineer”;“”;subject;“”;body;[IncludeDoclink]);

Subject: RE: button formula problem

Get rid of these things – “”. Except where you assign subject and body values, they don’t belong there.