Dot-walking extended fields in script

Mike McCall
Giga Guru

My coworker is looking to return a GlideRecord of Approvals for a specific type of Catalog Item, and it seems like we can't dot-walk to an extended field.

Here's what doesn't seem to work:

var grApprovals = new GlideRecord('sysapproval_approver');

grApprovals.addQuery('sysapproval.cat_item', '[sys_id of specific Catalog Item]');

I assume it's because sysapproval_approver.sysapproval ("Approval.Approval for") is a reference to the task ("Task") table and cat_item ("Item") is specific to the extended sc_req_item ("Requested Item") table.


To get around this, we then created a second GlideRecord of the Requested Item being approved. Is there a better way?

1 ACCEPTED SOLUTION

rgm276
Mega Guru

try using  


sysapproval.ref_sc_req_item.cat_item


View solution in original post

4 REPLIES 4

rgm276
Mega Guru

try using  


sysapproval.ref_sc_req_item.cat_item


Magic! I'll assume that you can always use "ref_[extended table name]" in order to dot-walk to an extended field, then.



Is there anywhere I should have found that in the Wiki, or is it just a secret?


I found this by when wanting to pull reference info onto a CMS page for change, I was able to use the 'copy query' function from a list


view/   I followed these steps to verify what the actual ref_ value was for your specific need.dotwalkCapture.JPG


Great tip! Thanks!