How to Create Ui action in csm workspace

instance
Tera Contributor

I am new to Servicenow. 

My requirement to create Case Record from incident table Using Ui action .( in Csm workspace)

i have Created a ui action named : Case.

On creating a New record and saving --> the Ui action button get enabled.

On clicking the Case button it is redirecting the Pop up window with new case record .

but in the case Record Parent Field i need to populate that particular incident number automatically how to do this.

 

i have done till the pop up window . i dont know how to do this -->case Record Parent Field i need to populate that particular incident number automatically

1611a.jpg

 

Ui action in workspace client script:

var url ='/sn_customerservice_case.do?sys_id=-1&sysparm_query=incident%3D'  +'&sysparm_view=workspace';;

g_modal.showFrame({
title: getMessage("Create case"),
url: url,
size: 'lg',
height: '380px',
autoCloseOn: 'URL_CHANGED',
})

 

help me with your script for that incident case relationship

10 REPLIES 10

@instance  

so you want to open record producer on click and there user will submit and create case and you want to link it with incident?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

yes bro you are correct that is the requirement and it should be in csm workspace

please help me @Ankur Bawiskar 

this is the record producer url

var url ='/com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=de45c412c312310015519f2974d3ae1b&sysparm_query=incident%3D'  +'&sysparm_view=workspace';;

@instance  

then you can send value as URL parameter and store the incident sysid in some variable of record producer

var url ='/com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=de45c412c312310015519f2974d3ae1b&sysparm_sysId=' + g_form.getUniqueValue() +'&sysparm_view=workspace';;

then use can use record producer script to store the variable value in the parent field

current.parent = producer.variableName;

1) to get the URL parameter value you can check this and use in onLoad catalog client script

var sysId = new URLSearchParams(url).get("sysparm_sysId");

g_form.setValue('variableName', sysId);

I hope I have provided enough help for you to proceed.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@instance  

I already shared the details and approach and I believe you can take it forward from here.

Although you are new there are lots of blogs/links which you can go through.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader