Set value in client script not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2016 04:30 AM
Hi All,
I have written a client script and script include to pull bulk number of email id and setting these email ids in catalog field after submitting the form.
The email ids are coming from the script include but it is not setting into the field.
field type is Multi line Text
Client script
var product= g_form.getValue('product_line');
var ga = new GlideAjax('Test');
ga.addParam('sysparm_name','getAllContactsofAccount');
ga.addParam('sysparm_product', product);
ga.getXML(returnContact);
function returnContact(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
g_form.setValue('contact_email',answer);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2016 10:26 PM
OK, that rules out the length issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2016 03:47 AM
Yes, getXMLWait does not work in application scopes. Can you try something like setTimout?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2017 04:00 AM
any other suggestion to set the value before giving control of the form to user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2017 05:24 AM
I have achieved this through workflow run script.
Thanks everyone for your response.