Requiremetn on the UI action

dhineshkumar
Tera Guru

Hi Experts 

I have the requirement on the UI Action on my Incident form. I have to create the button on the incident form "Create Request" Once I click on the create request  button it should creates the request under the Incident form. 

Thanks in advance.

1 REPLY 1

Krushna R Birla
Kilo Sage

Hi @dhineshkumar 

 

You can use below code in your UI Action on Incident table

 

var grReq = new GlideRecord('sc_request');
grReq.initialize();
grReq.parent = current.sys_id;
grReq.requested_for = current.caller_id;
grReq.opened_by = gs.getUserID();
grReq.short_description = current.short_description;
grReq.insert();
 
 
Other way is, you already have Create request UI Action on incident table which is configured for Form context menu. You can enabled same for form button if required, else you can use above code in your new UI Action script.
 

This will definitely helps you to resolved your issue. Let me know in case you need to understand the flow or you can DM on LinkedIn.

 

If this solution resolves your query, kindly mark it as the accepted solution and give it a thumbs up.

 

Best Regards,
Krushna Birla