- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 06:15 PM - edited 08-04-2023 06:19 PM
On the configurable workspace view is an user record, there is a UI action button on the record that needs to open a "new" incident form that should have pre populated values from the user record. like email, name should be transfered from user record to the "new" incident form in new tab on workspace view
How to handle this through the workspace client script section in the UI action. I am able to fetch the form values (email,name) in workspace client script but not very sure about the way ahead to open a pre populated fields"new" incident form in tab on the same workspace view.
Request your inputs, tips.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2023 12:07 AM - edited 08-05-2023 12:08 AM
Hi,
Create UI action and use below in your script. If you UI action is NOT client side then you don't have to worry about any additional configuration for it to work in workspace.
var newRecord = new GlideRecord("TABLE");
newRecord.initialize();
newRecord.setValue("YOUR_FIELD", current.getValue("FIELD1"));
newRecord.setValue("YOUR_FIELD2", current.getValue("FIELD2"));
action.openGlideRecord(newRecord);
Make sure to check the workspace form button field.
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 06:54 AM
Hello Jagjeet,
Did you get a chance to get my earlier response query. I look forward to your expert inputs.
let me paraphrase this - The code works when I have the UI action on workspace as non client. Clicking on button opens a new form as desired.
However, my ui action has a workspace client script that shows a modal window with a field and a submit button. When I click on submit , it must get values of the field and then open the new form with populating a field on the form with the selected value.
The moment I make my Ui action client checked. it doesnt work and open new form.
Part 1 is working without the workspace client script.
I need the part 2