My custom Approve ui action will not override the default Approve ui action

marif
Kilo Contributor

So,

I need a custom Approve ui action on the approvals table for a specific requested item; I've already made this ui action and it works as desired. My issue is, I cannot get my custom Approve to override the default Approve ui action on requested item approvals so I'm stuck with 2 Approve buttons on the form.

I've already tried Insert and Stay, naming them the same, giving them the same action name, and decreasing the order of my custom ui action - none of these have worked. I'm also restricted to making changes on my button only, I am not permitted to touch the default button and this default button is required for all other requested item approvals, and using a client script or scripted ui policy may not pass my code review for my client.

Please help.

7 REPLIES 7

veena_kvkk88
Mega Guru

Hi Maricel,



You said you want custom UI action for specific requested item. Does that mean you are trying to use OOB Approve button for other requested items in the same table?


Yessum


I'm not sure if UI actions work that way, but let's give it a try. Did you include in the condition field the requested item you want this to appear on? Because if not, that UI action appears for every record in that table in addition to the OOB one. Please share a screenshot of your UI action, so we can help you identify what's wrong.


Yessum my custom ui action only appears on the approvals for my specific requested item and on no other requested item approval. Below is a screen shot of my custom Approve ui action:



Condition: (current.state == 'requested' || current.state == 'deferred') && (gs.hasRole('admin') || gs.hasRole('approval_admin') || isApprovalMine(current)) && current.document_id.cat_item == '959b71bf0f156200916e5858a1050ec7'


find_real_file.png



And here is the default Approve ui action for the rest of the requested item approvals:


Condition: (current.state == 'requested' || current.state == 'deferred') && (gs.hasRole('admin') || gs.hasRole('approval_admin') || isApprovalMine(current)) && new ITGRCTools().useGlobalApproveButton(current.sysapproval.sys_class_name)


find_real_file.png