Issue with client side API method on workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 12:47 AM
g_aw.openRecord (tablename, sysid, params); isnt working.
I am trying to open incident form and auto populate short description on the new incident form through workspace client script of a UI action.
Here is the snippet -
var getShortDescription = g_form.getValue('short_description');
g_aw.openRecord ('incident', '-1', {short_description : getShortDescription } );
The above opens a new incident form but the short description is not getting populated. This code is written in workspace client script section of a UI button. It is client callable checked.
Note that I am able to get the value of ' g_form.getValue('short_description');' in an alert. The population part of g_aw.openRecord isnt working. Followd the documentation but stuck with this fields population part.
Any inputs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 12:55 AM
Hi @Snehal13 what is the workspace you are using for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 11:19 PM
CSM workspace. the API method works , just the params part isnt working. following this https://docs.servicenow.com/en-US/bundle/utah-api-reference/page/app-store/dev_portal/API_reference/...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 12:00 AM
An UPDATE - This code works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 01:03 AM
Hello @Snehal13 ,
Can you try this once ?
var getShortDescription = g_form.getValue('short_description');
g_aw.openRecord ('incident', '-1', "params": {
"short_description":getShortDescription;
} );
If this answer helped you please mark it correct
Thanks