UI action with out of the box form widget

Toren
Kilo Guru

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.

1 ACCEPTED SOLUTION

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);

View solution in original post

3 REPLIES 3

Allen Andreas
Administrator
Administrator

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!

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);

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:

find_real_file.png

and

find_real_file.png

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!