The CreatorCon Call for Content is officially open! Get started here.

pdf file is not generating in hr case table

chandan31
Tera Contributor

Hi All,

 

Pdf file is not generating in the HR case whenever i am using before business and state changes to awaiting acceptance and hr service is one of "  "

Please find the script:

 

if (current.hr_service == '5d16185187c47d146c44b95e8bbb35d4') {
        gs.info('chandan pdf ');
        new sn_doc.GenerateDocumentAPI().generateDocumentForTask(current.sys_id, 'd814c810877cf5d46c44b95e8bbb35be'"SLOA - " + current.subject_person.getDisplayValue());
    }
To generate file I have used document template and document template script .
 
while changing the state awaiting acceptance manually file is generating but automatically is not generating .
 
Please help.
4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@chandan31 

are you sure the BR is running?

Did you add logs and debug using gs.info()?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yes , BR is running but whenever we are changing state .but the automation is not woking.

 

logs also coming in the logs table .

@Ankur Bawiskar 

 

Can you guide me how to resolve this issue.

 

Thanks,

Chandan Patra

@chandan31 

you haven't shared the relevant scripts and business rule screenshot etc

So it's difficult to guide

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Script written in Business rule :
if (current.hr_service == '5d16185187c47d146c44b95e8bbb35d4') {
        gs.info('chandan pdf ');
        new sn_doc.GenerateDocumentAPI().generateDocumentForTask(current.sys_id, 'd814c810877cf5d46c44b95e8bbb35be'"SLOA - " + current.subject_person.getDisplayValue());
    }