How can you show a UI action button from one table in a form from another table?

mitzaka
Mega Guru

Hi guys,

 

I have a question about UI actions. It's about Change Management in particular. In changes, you have the Approvers tab, where you can click on an approval, which takes you to the Approval form. Inthere, you can see a form button 'Approve', which is actually a UI Action, bound to the table sysapproval_approver.

 

What I want is to show this form button directly on the Change Form(as well). How can I do that? If I am getting it right, by default the UI actions you see on the change form are bound to the change_request table.

 

If anyone has experience with such interface customization, I will be more than happy to read it:)

Thanks!

6 REPLIES 6

sach1
Tera Guru

Hi,



You can create a UI action on Change Request form with proper conditions as in the 'Approve' UI action.



>Create a function which gets 'number' of the Change Request and 'Logged In' user's name.


>GlideRecord 'sysapproval_approver' table.


>User 'number' and 'Logged In' User name to Query.


>Change the State of approval record to 'Approved'



Thanks,


Sachin


Hi Sachin,



Thanks for the quick reply. One question though - if I have a group   of approvals (sole approval works, the others get cancelled then), would that still work - I want it not only to modify the state of the approval field on the change form, but to modify the approval in the approvals tab. You think that would still work?





You can have a look at OOB 'Approve' UI action for Change Request.



In the UI action they call a function:


new UIActionUtils().approvalsNoLongerRequired(current.sys_id);


once the state is approved,no longer approvals will be required.



In addition You need to combine this with 'Approve' UI action for 'sc_req_item' table. In this you will find the exact GlideRecord method I said in the earlier comment. After Changing the state to approve, try using using above UIActionUtils() so that other approvals are not required.



Good Luck.


sasi5
Kilo Contributor

Hi Dimitar, Its quite a old   thread but i do have a similar requirement now. Did you able to recall what   have you implemented in the past?



There is a UI action in the Sys_approval record "Return for review" and Client wants another UI action   in the Change request form which should work exactly the same way as the "Return for review"   in sys_approval record.



Any pointers will be reallyhelpful



thanks,


Sasi