Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6926 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a layout that uses a plug-n called MMEmail. I have three fields I have set as Required but users can still use the MMEmail function to email portions of the layout even if they haven't filled out the required fields yet. The plug-in simply calls up an email window which is populated with merge fields and emails it using a local email client as support.

When the user clicks on the button to summon the email window I would like to see that script validate those three fields. The fields are a Date filed, and two Text fields. Any ideas?:)

Let (

[

To = Purchase::SendToMail ;

Subject = "Purchase Request Approval Needed" ;

Body = "Your approval is requested for the following purchase order by <>:)¶¶Purchase ID#: <>¶Product: <>¶Quantity: <>¶Total Cost: <>¶¶Date Requested: <>¶Program: <>¶Vendor: <>¶Pro Card Purchase: <>¶¶Comments: <>" ;

Attachment1 = "" ;

Attachment2 = "" ;

Attachment3 = "" ;

MergeFields = "" ;

SendEmail = "True"

];

MMEmail_ShowMessageDialog( To ; Subject ; Body ; Attachment1 ; Attachment2 ; Attachment3 ; MergeFields ; SendEmail )

)

Posted

Add a commit records/requests script step prior to the script step that calls the plugin. This will trigger the validation, and if you Set Error Capture [on], you can use Get(LastError) in an if statement to control the flow of your script based on the validation.

Commit Records []

If[Get(LastError)=0] //no error found

Set Field [pluginField;pluginFunctionCalls]

Else

Show Custom Dialog [you need values in blah blah fields...]

EndIf

You can make it more complicated than this to test for more different things, but that's the basic idea.

This topic is 6926 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.