How to Create Ui action in csm workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 07:00 PM
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 09:46 PM
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?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 09:50 PM - edited 11-15-2022 09:51 PM
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';;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 10:35 PM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 11:16 PM - edited 11-15-2022 11:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 11:40 PM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader