- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 01:27 PM
Hi everyone,
I am trying to get my UI action on the out of the box form widget in portal to work. All it needs to do is change the state field value to 'approved'
When I make it client callable, it disappears from the form widget. I have tried both below methods, but neither work. Either current is not defined or g_form is not defined.
current.state = <value>;
current.update();
g_form.setValue('state', ?); //replace ? with the value of the field you wish to change it to
Any help would be appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 01:57 PM
For anyone else who makes this dumb mistake like me, you need to have the outer function defined with the proper parameters so that current is defined.
(function(current, previous, gs, action){
current.setValue('status','approved');
current.update();
})(current, previous, gs, action);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 01:48 PM
Hi,
Client Side UI Actions won't show on the portal, so that's why that is happening. Please uncheck the client checkbox and proceed with using "current", there.
If it's still not working, please share a screenshot of the entire UI Action and it's settings so we can take a look.
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
‎01-20-2022 01:57 PM
For anyone else who makes this dumb mistake like me, you need to have the outer function defined with the proper parameters so that current is defined.
(function(current, previous, gs, action){
current.setValue('status','approved');
current.update();
})(current, previous, gs, action);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 02:01 PM
Hi,
I'm glad that seemed to work for you, but there are numerous out of box UI Actions without "current" defined in as a function pass-in...
This among many other examples:
and
Which is for the "approve" UI Action within the system (for example).
Just mentioning this as I don't want the community thinking that that is actually needed.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!