- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2016 03:59 AM
Hi All,
I have created textarea field on ui page
<textarea type="text" style="margin: 0px;width:300px;height: 64px;" > </textarea>
and a submit button
<button class="listactions" type="submit" onClick="return submit();" id="submit" name="submit" > ${gs.getMessage('Submit')} </button>
On clicking of the submit button the text in the text field should get added in serviceNow custom table.
How I can achieve this?
Kindly help..
Regards,
Akshay
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2016 04:15 AM
Hi Akshay,
Have an id attribute for the text area tag. Use document.getElementById("textAreaId").value to fetch the value of the text area field.
Perform the above in client script of ui page. When you are using the submit button, call a onSubmit method add add the above code in that method in client script section. you can then query the table using gliderecord and update whatever field you want with the value present in text area.
Mark my reply as Correct and also hit Like and Helpful if you find my response worthy.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2016 06:25 AM
Hi Ankur,
I have tried with this code,alert is getting generated but the value is not getting updated in the custom table
Can you please help me with this
if(gr2.text=="")
{
alert("gr2");
gr2.autoSysFields(false); // Do not update sys_updated_by, sys_updated_on, sys_mod_count, sys_created_by, and sys_created_on
gr2.setWorkflow(false); // Do not run any other business rules
gr2.setValue('field1', text);
gr2.setValue('field2', text);
gr2.update();
}
Regards,
Akshay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2016 06:48 AM
Hi Akshay,
I am sure that setWorkflow(false) doesn't work in client script. Can you add alert before and after the line of setWorkflow(false) to check whether it is causing the error
If that doesn't work you can have a GlideAjax in client script to call script include. That should finally work
Mark my reply as Correct and also hit Like and Helpful if you find my response worthy.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2016 10:26 PM
Thanks Ankur,
I used Glide Ajax and thats working fine for me.
Regards,
Akshay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2016 01:54 AM
Hi Akshay,
Good to know that it worked.
Can you also mark my answer as helpful and hit like if your issue was resolved. Thanks in advance
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2016 03:54 AM
Already done