How to dot walk in Ui Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 09:22 AM
Hi All,
How can we dot walk the fields of a RITM form, from approval table record .
Like in my instance there is field call"Title" I want to dot walking this field from ui action on approval table.
Regards,
Pratik Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 09:25 AM
Hi,
Please use this line of code in your UI Action on approval table
If title is a field on requested item table then use
current.sysapproval.title; //Title is the field name on your RITM
If title is a variable on requested item table then use
current.sysapproval.variables.title; //Title is the variable name on your RITM
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 10:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 10:42 AM
The code will work if you are changing the script fully to server side using current object. Is it possible?
You can also mix client and server code in a UI Action: http://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/
Or else you can try this but it is always better to use Glide Ajax for such cases.
var ritm = g_form.getReference('sysapproval');
var title = ritm.u_title; //ritm.variables.title whichever matches your variable name
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 09:49 AM
Hi Pratik,
I believe the 'Title' is a field in your RITM form and the UI action is in the Approval table (sysapproval_approver). If this is correct, then you can do dot walking via the OOB field 'Approving for' (sysapproval). In your scenario, it will be like current.sysapproval.u_title (considering the name of the 'Title' field is 'u_title').
If the UI action in the Group Approval table (sysapproval_group), you need to do dot walking via 'Parent' (parent) field. this time you need to do as current.parent.u_title.
I hope this helps.Please mark correct/helpful based on impact