How to create new related request for request form

Research
Tera Guru

Hi

Has any one guide me with Ui action 
I want to create new Ui action for Request form which should create new Request form like Child request 
For this I want to create custom Ui action like Related Request 

Please guide me with script and steps 

Research_0-1702053029861.png

Like create work order Ui action
I want to create Request (sc_request)




Thanks in advance.

7 REPLIES 7

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Research 

 

1st , thing there is noting called Child Request , but it is Req Item.

2. The process of creating Req is always catalog / item.

3. What is the use case of this req.

 

To understand the child concept, have a look in to Child Incident UI action and incident properties.

LearnNGrowAtul_0-1702053797930.pngLearnNGrowAtul_1-1702053836739.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Research
Tera Guru

Hi @Dr Atul G- LNG  Thanks for suggestion
we have a custom request table, so  we want to create internal ticket which is request
Like related request is option instead of tasks
Can you guide me steps to create it

Thanks in advance

Hi @Research 

 

we have a custom request table, so  we want to create internal ticket which is request

Atul: Got the point. 
Like related requests is option instead of tasks

Atul: It is a good customization, as you need to create a UI action and write the code to copy the existing Req. Pleae refer to Create Child Incident, on the incident table to get an idea.
Can you guide me steps to create it

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Harish KM
Kilo Patron
Kilo Patron

Hi @Research You can use the below UI Action script as sample. set the form context menu to true to appear UI action under context menu

 

HarishKM_0-1703228254116.png

 

var newRecord = new GlideRecord("sc_request"); //table where you want to create request
newRecord.initialize();
newRecord.setValue("parent", current.getValue("sys_id")); // pass the sysid to request table to keep as reference

if(!gs.nil(current.requested_for))
    newRecord.setValue("requested_for", current.getValue("requested_for")); // map the fields
   
if(!gs.nil(current.short_description))
    newRecord.setValue("short_description", current.getValue("short_description"));// map the fields

if(!gs.nil(current.description))
    newRecord.setValue("description", current.getValue("description"));// map the fields


action.openGlideRecord(newRecord);// redirects to request record.
Regards
Harish