Adding communication tasks on incident related list

Liz Abraham
Tera Contributor

Hello,

 

I am trying to add a related list on the incident form that has related communication tasks from the incident_alert_task table. I created a relationship below . it shows me all records from the incident_alert_task but not of the specific incident when I open the incident. What am I missing?

 

LizAbraham_0-1685661381650.png

 

1 ACCEPTED SOLUTION

Manmohan K
Tera Sage

Hi @Liz Abraham ,

 

Please correct the code in the Relationship Communication Tasks as shown below

function refineQuery(current, parent) {

    current.addQuery('source_incident', parent);

})(current, parent);

 

I have tried on my PDI and its working

ManmohanK_0-1685676180550.png

 

 

View solution in original post

14 REPLIES 14

the customer's requirement is to have a button on the incident form that creates a comm plan when the button is clicked with it's associated tasks. are you saying we have to script using the advanced option in the relationship record?

Yes, In the relationship record we have to script using the advanced option

Liz Abraham
Tera Contributor

was able to with the help of my colleague and used 'incident_alert.source_incident' in the script. this shows now only those associated with the incident.

Hello Liz , Can you share the relationship code  here. Since I tried the accepted solution code and its not working. Its showing me entire Incident communication task records. and then I tried  'incident_alert.source_incident' but its showing me no record at all.

 

Liz Abraham
Tera Contributor

Hi Sneha,

 

See below.

 

LizAbraham_2-1695847102251.png

 

Hope this helps.