UI action log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 08:54 AM
How to add log statements in UI action to see if it is running. Is the syntax below is correct? gs.log() in my script.
gs.log("Inside the log");
I created a UI action and I want to test if it is triggering or not?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 11:05 AM
I checked into Log Entries with Source is Script and it appears approve "list choice UI action" didn't generate logs.
Can someone please look into syntax if it is correct?
CONDITION
current.state == 'submitted' && (gs.hasRole('timecard_approver') || gs.hasRole('timecard_admin'))
SCRIPT
current.state="approved";
current.update();
gs.log("Inside the log","UI_ACTION_NAME");

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 11:15 AM
Your script seems fine. Can you try adding the gs.log to be the first line of the script and see if you get anything when someone click on the UI action.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 11:17 AM
Try with:
current.state = 'Approved';
I have time card/time sheet on my instances too and when looking at those values...they are the same as the label...meaning Approved, Pending etc. and not approved, pending.
Please verify your state choices.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 11:20 AM
Also...there's already a UI Action for approving these...that you may want to look in to, but if you're unable to locate it...here's a screenshot of mine (mine is inactive, because we don't want users using list approval like that)...
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2019 08:07 AM
Hi,
Let me know if you need any further assistance.
If my reply above solved your question, please that reply as "Correct".
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!