Apply template via Inbound Email Action

Mouli8
Giga Contributor

There is a template(Incident), which has related child templates(incident_task).

When I apply template via Inbound Email Action on Incident and try to set other fields(description) like below,

then the parent template is applied, but the related child templates are not applied.Any idea ,what Is incorrect?

current.applyTemplate('Incident_Template');
current.description = email.body_text;

current.short_description='abc';

current.insert();

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

Try

 

GlideTemplate.get(<template sysid>).apply(GlideRecord)


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

3 REPLIES 3

SanjivMeher
Kilo Patron
Kilo Patron

Try

 

GlideTemplate.get(<template sysid>).apply(GlideRecord)


Please mark this response as correct or helpful if it assisted you with your question.

Hi Sanjeev, The template can be apply via applyTemplate syntax.My problem here is child templated is not been called. If i do, current.applyTemplate(template name); current.insert(); ,them everything works fine. But if i do as per below,then only Parent template is applied and not the child templates: current.applyTemplate(template name); current.description = email.body_text; current.insert();

can you try current.setValue('description',email.body_text);


Please mark this response as correct or helpful if it assisted you with your question.