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-28-2016 04:33 AM
Hello Neethu,
Try putting some log statements and see what values are being stored in the variables used. This is the first line of debug. Let's start with this first.
Thanks,
Arnab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2016 10:43 PM
The values getting from script include is coma separated email ids.
And in client script also these value are stored in the 'answer' variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2016 04:47 AM
Try this
g_form.setValue('contact_email',answer.toString());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2016 11:43 PM
I have tried this but no luck.
the value returning from script include also coma separated email ids.