How to add a field from another table in notification

hongsok
Tera Contributor

Dear all,

I am working on the email notification on the table name "Assessment Instance [asmt_assessment_instance].

I would like to add a field call "business_case" form another table name "dmn_demand]

I tried to use the following email script but it is not working.

var gr = new GlideRecord("dmn_demand.business_case");

gr.get(current.trigger_id);

template.print("business_case");

I have tried to add the following to the notification message and it's not working as well

Business case: ${dmn_demand.business_case}

I would appreciate your help.

 

6 REPLIES 6

assuming trigger_id is the ref field on asmt_assessment_instance

this will get you your values:

var gr = new GlideRecord('asmt_assessment_instance'); //trigger_id
gr.query();
while (gr.next()){
    gs.print(gr.trigger_id.business_case);
}

hongsok
Tera Contributor

Hi Brian,

I changed to the following way and it works now but label & value does not stay in the same line (see the picture at below).

Any idea?

<mail_script>
     var gr = new GlideRecord("dmn_demand");
     gr.get(current.trigger_id);
     template.print("Business case:"+gr.business_case);
</mail_script>

 

find_real_file.png