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

Since it's on the same table, the OOB 'Approve' also appears along with your custom button. I can only think of adding this condition to OOB button: current.document_id.cat_item != '959b71bf0f156200916e5858a1050ec7'


But that would mean modifying OOB UI action. I'm not sure how else this can be achieved.


Ha yah I know I'll bring it up with my PM and see if that's an acceptable solution; until then, thank you and I hope someone else will maybe know what else I can do ha



Thanks again


Hey Maricel,



I just thought of something. Override the 'Approve' UI action (OOB) -> within the script, check for the record you want(not in condition) -> like this: if(current.document_id.cat_item != '959b71bf0f156200916e5858a1050ec7') and use the code you wanted to. And in else, copy the OOB code -> Click 'Insert & stay' so it creates new button without changing existing one -> And just make the OOB button inactive. This way you only have one 'Approve', and you won't be changing OOB code. Don't know why I didn't think of this before because this is how it has to be done whenever OOB functionality has to be changed.