jbullydawg Posted February 8, 2006 Posted February 8, 2006 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 ) )
Reed Posted February 9, 2006 Posted February 9, 2006 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now