AnsweredAssumed Answered

Server Side Email with Record Data

Question asked by episking on Sep 12, 2014
Latest reply on Sep 12, 2014 by episking

Title

Server Side Email with Record Data

Post

I have a form that users fill out and click submit.  Currently I have the submit button set to run Script1 which is not a server side-script.  Script1 does the following:

         
  • Commit Records/Requests
  •      
  • SetVariable [$$RecordNumber; Value:Get (RecordNumber)]
  •      
  • Go to Record/Request/Page [No dialog; $$RecordNumber]
  •      
  • Perform Script on Server [Wait for completion; "Script2-ServerSide"]

 

Script2-ServerSide does the following:

         
  • Go to Layout ["ProperLayoutName" (ProperTableName)]
  •      
  • Go to Record/Request/Page [No dialog; $$RecordNumber]
  •      
  • Send Mail [Send via SMTP Server; No dialog; To: "recipient@mail.com"; Subject: "New form - " & ProperTableName::Submitter Name & " - " & ProperTableName::Project Name & " - " & ProperTableName::Timestamp]

 

The email comes through just fine, and it pulls the data, but always from the first record.  I can't seem to figure out how to get the server-side script to pull the proper record's data.  I do have a field named "docKey", that is an Auto-Entered serialized number, non-editable (a primary key, essentially), so I could do a lookup based on that field?

Open to suggestions to get the proper record's data into the email.

 

Thank you!!!

-Eric

Outcomes