Document Task Description not updating after creation through Flow Action Script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
29m ago
Hi Team,
I am using a Flow Action Script to generate document tasks using sn_doc.GenerateDocumentAPI().initiateDocumentTasks().
After the document task is created, I am querying the sn_doc_task table and updating the short_description and description fields based on the participant value.
var docTask = new GlideRecord('sn_doc_task');
docTask.addQuery('parent', inputs.hr_case);
docTask.addQuery('document_template', templateId);
docTask.orderByDesc('sys_created_on');
docTask.setLimit(1);
docTask.query();
if (docTask.next()) {
docTask.short_description = 'Sign the finalised severance letter';
docTask.description = 'Updated description';
docTask.update();
}
The document task is being created successfully, but the updated short description and description are not getting reflected on the generated document task.
Could this be because the document task is created asynchronously and the update logic is running before the task record is fully available?
Has anyone faced a similar issue with GenerateDocumentAPI().initiateDocumentTasks()? Would an After Insert Business Rule on the sn_doc_task table be a better approach for updating the task fields?
Any suggestions would be appreciated.
Thanks.
0 REPLIES 0