Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Issue with client side API method on workspace

Snehal13
Kilo Sage

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. 

6 REPLIES 6

Hi Mohith, an UPDATE - This code works

 

var query = "short_description=" + short_description_text;

        g_aw.openRecord('incident''-1', {
        "query": query
    });
 
Now, need to know how to pass multiple values like category, priority etc in 'query'
 
Any inputs

Hello @Snehal13 you can append like this i believe

var query = "short_description=" + short_description_text+"&priority="+priority

some thing like this but not sure if it works ....you can try it.

Hope this helps