Approval email

samadam
Kilo Sage

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?

 

2 REPLIES 2

Allen Andreas
Administrator
Administrator

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!

samadam
Kilo Sage

 tried it but document_id is showing null. "Benefit Form: null". It gets the table name but not the id.