Need to create a Request from a Change Record in the SOW and native view using a UI Action

Abhilasha G T
Tera Contributor

 

Hi Team,

 

I should be able to create a Request from a Change Record in the SOW and native view using a UI Action/Context Menu Action.

 

I have created UI action for native UI View and used the below script.

 

//Update saves incidents before going to the catalog homepage
current.update();
var url;
var activeCatalogsCount = sn_sc.Catalog.getCatalogCount();
if (activeCatalogsCount === 1) {
    url = "catalog_home.do?sysparm_view=catalog_default&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id;
}
else {
    url = "catalogs_home.do?sysparm_view=catalogs_default&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id;
}
action.setRedirectURL(url);
 
Able to create a request through change form, but under the related list tab >Request,  but not able to  establish the relationship between the original Change and the created REQ.
 
AbhilashaGT_0-1740474748379.png

 

AbhilashaGT_1-1740474826131.png

 

 

how to achieve this?

 

Regards,

Abhilasha G T

 

 

 

7 REPLIES 7

Toderean alexan
Tera Contributor

Hi @Abhilasha G T,

 

 Every parent child relationship involves a link at the reference level, it is necessary the add the parent sys_id to the child's specific reference list. For example the problem has that "Request for Change" field.

Hi Alexan,

 

Hope's all good.

 

can you please elaborate here how to link parent child relationship. I tried  its not working as expected , please check the this below  script , any modification required, let me know.

I have created UI action for native UI View and used the below script.

 

//Update saves incidents before going to the catalog homepage
current.update();
var url;
var activeCatalogsCount = sn_sc.Catalog.getCatalogCount();
if (activeCatalogsCount === 1) {
    url = "catalog_home.do?sysparm_view=catalog_default&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id;
}
else {
    url = "catalogs_home.do?sysparm_view=catalogs_default&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id;
}
action.setRedirectURL(url);
 
Regards,
Abhilasha G T

 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Abhilasha G T 

 

Could you clarify your use case? Generally, a change is raised via a request, not the other way around, and it's not considered best practice to do so.

*************************************************************************************************************
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]

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

Hi  AG,

 

Thanks for your reply,

 

Below is my requirement,

 

  • As a Fulfiller,
    I should be able to create a Request from a Change Record in the SOW and native view using a UI Action/Context Menu Action
  • This should take me to a view of the Catalog, allowing me to select the Catalog Item I want to submit
  • A relationship should be established between the original Change and the created REQ (ideally RITM)

Regards,

Abhilasha G T