Hello!
I am trying to utilize Workflows to automatically generate a specific PDF template, as well as a document, and link that document to the opportunity.
I can see that my conditions are being met, and the workflow is being triggered. However, no PDF/document is appearing on the opportunity. So, I must have something wrong here.
Below are the text and a screenshot of the formula I am trying to utilize. Any insights the community can offer will be greatly appreciated!:
// Defining the ID of the PDF template being generated.
$pdfTemplateId = '68cae75dc3802a542';
// Definining the PDF's filename using the Opportunity's name.
$fileName = string\\concatenate(entity\\attribute('name'), '-Agreement.pdf');
// Generating the PDF and getting the attachment ID.
$attachmentId = ext\\pdf\\generate('Opportunity', entity\\attribute('id'), $pdfTemplateId, $fileName);
// Creating a "Document" record.
$documentId = record\\create('Document',
'name', $fileName,
'fileId', $attachmentId
);
// Relating the created Document record to the Opportunity.
record\\relate('Opportunity', entity\\attribute('id'), 'documents', $documentId);
I am trying to utilize Workflows to automatically generate a specific PDF template, as well as a document, and link that document to the opportunity.
I can see that my conditions are being met, and the workflow is being triggered. However, no PDF/document is appearing on the opportunity. So, I must have something wrong here.
Below are the text and a screenshot of the formula I am trying to utilize. Any insights the community can offer will be greatly appreciated!:
// Defining the ID of the PDF template being generated.
$pdfTemplateId = '68cae75dc3802a542';
// Definining the PDF's filename using the Opportunity's name.
$fileName = string\\concatenate(entity\\attribute('name'), '-Agreement.pdf');
// Generating the PDF and getting the attachment ID.
$attachmentId = ext\\pdf\\generate('Opportunity', entity\\attribute('id'), $pdfTemplateId, $fileName);
// Creating a "Document" record.
$documentId = record\\create('Document',
'name', $fileName,
'fileId', $attachmentId
);
// Relating the created Document record to the Opportunity.
record\\relate('Opportunity', entity\\attribute('id'), 'documents', $documentId);

Comment