hasattachments() giving false on request item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-13-2018 12:06 PM
creating one business rule which is giving hasattachments() = false despite of having a attachment with record from portal. any idea.
this is created on
Table = sc_task
After insert.
(function executeRule(current, previous /*null when async*/) {
var rec = new GlideRecord('sc_req_item');
gs.log("current.request_item " + current.request_item,"test");
rec.addQuery('sys_id', current.request_item);
rec.query();
gs.log("current attachments " + rec.hasAttachments(),"test");
if(rec.next() && rec.hasAttachments()){
current.work_notes = "RITM number is this:" + rec.number;
current.update();
}
})(current, previous);
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-13-2018 12:31 PM
FYI- I am trying to create the request from the portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-13-2018 12:55 PM
It would be helpful if you explained what you are actually trying to accomplish. Looks like you are trying to add a work note to the Catalog Task record if the RITM has an attachment. Is that correct? If so, what if the attachment is added after the CTASK is created?
You might want to look at this post if you want to see attachments on the RITM from the CTASK record - "Related Attachments" Related List.