- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2020 06:00 AM
I'm trying to replicate a UI action from ServiceNow self-service into the ServiceNow Agent mobile app.
I created a function in studio (context: Record) to call an action item (use current record as condition is true) which is of type: Script.
I copied the script from UI Action to the script in the action item.
I already added this action into the footer function of the Applet.
The script's purpose is to:
1- Update the current record
2- Update the parent record
The button appears correctly with the given conditions of the current record, but when i trigger the script by clicking the button, this error appears:
Seems like the current object is not accessible, but it is available on the right side selection:
Can anyone guide me about this problem?
Thank you so much!
Solved! Go to Solution.
- Labels:
-
Agent Mobile App
-
Mobile Studio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2020 03:09 AM
Update:
I was able to make this work by passing the sys_id in input and then using a GlideRecord to access the fields I want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2020 06:18 AM
instead of
current.parent
try
input.parent
and make sure you have parent as Item parameter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2020 03:22 AM
Hi Mike,
Thanks for your answer. However, I still need to access the current object (the record where I clicked the button) as I will do a current.update() in the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2020 03:09 AM
Update:
I was able to make this work by passing the sys_id in input and then using a GlideRecord to access the fields I want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 05:15 AM
Hi JP22,
How you are passing the sys_id here, can you explain.
Thanks,
Sourin