- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 11:04 PM
Hi All,
I am not able to update or create or delete record in Document Tasks using
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 12:34 AM
Document task table is in "Document templates" application scope. We don't have option to select this scope in background script. For this scope related error you need to create restricted caller access record.
Second way to achieved this is change your scope to "Document templates" and Create fix script. So this fix script will get created in "Document templates" only and then add your code. Then simply click on "Run Fix script".
Also in your code, parent is a reference field so use the HR case sys ID instead of HR case number
var gr = new GlideRecord('sn_doc_task');
gr.addEncodedQuery('number=DOCT0001111);
gr.addQuery('parent','a07f7b8e8a9370cbb354edfdffdfdfdf');
gr.query();
if(gr.next()){
gs.info(gr.number);
gr.setWorkflow(false); //Disable business rules for this query
gr.deleteRecord();
}
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 12:34 AM
Document task table is in "Document templates" application scope. We don't have option to select this scope in background script. For this scope related error you need to create restricted caller access record.
Second way to achieved this is change your scope to "Document templates" and Create fix script. So this fix script will get created in "Document templates" only and then add your code. Then simply click on "Run Fix script".
Also in your code, parent is a reference field so use the HR case sys ID instead of HR case number
var gr = new GlideRecord('sn_doc_task');
gr.addEncodedQuery('number=DOCT0001111);
gr.addQuery('parent','a07f7b8e8a9370cbb354edfdffdfdfdf');
gr.query();
if(gr.next()){
gs.info(gr.number);
gr.setWorkflow(false); //Disable business rules for this query
gr.deleteRecord();
}
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!