Approval email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2024 01:40 PM
I have a workflow for a custom table where I am creating Approval - User record. I am trying to customize the approval to include the fields in a mail script but cannot access the custom table record. How can i access the record fields? Approving field on the Approval shows null. How can I access the fields in the mail script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2024 06:07 PM
Hello,
If your workflow is on the custom table and you have an approval activity in it, then that approval record should be associated to your custom table record. With that said, in your mail script, you can use GlideRecord to find that record and then use the fields as you need, for example:
var gr = new GlideRecord('custom_table_name_here');
gr.get(current.document_id);
template.print("Field A is: " + gr.getValue('u_field_a'));
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2024 07:02 PM
tried it but document_id is showing null. "Benefit Form: null". It gets the table name but not the id.