dot walking to approver name from sc_req_item record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2011 08:55 AM
i m trying to get the approver name of the requested item by dot walking from the current object.
current object is of requested_item.
any suggestion?
current.approval gives me the approval state but how do i get who are approvers for this current record?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2011 09:20 AM
You need to query the sysapproval_approver table as far as I am aware.
var gr = new GlideRecord("sysapproval_approver");
gr.addQuery("sysapproval", current.sys_id);
gr.query();
while(gr.next()) {
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2011 09:21 AM
You can't dot-walk to an approver because there can be many approvers on a given task. For this same reason, you can't reliably determine who the current approver is. I think the best you could do would be to query the sysapproval_approver table for any approval records that were in a 'requested' state.
var app = new GlideRecord('sysapproval_approver');
app.addQuery('sysapproval', current.sys_id);
app.addQuery('state', 'requested');
app.query();
while(app.next()){
//Do something
}