- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2020 10:58 PM
Hi all,
I have i doubt, can we change the value of some field based on other field value change using oncellEdit() client script?
For example, if i change the value in short description, can i add old short description to description.. such kind of senario is possible using onCellEdit()?
Thanks and regards,
Tejaswini.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2020 04:08 AM
Hello Tejaswini,
check below screen shots for client script and script include to achieve the requirement.
Client script:-
Script Include:-
Please mark helpful and correct if my answer is worthy.
Thanks and regards
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2020 11:14 PM
Hi Tejaswini,
in general, you may want to use the setValue method of GlideForm:
https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=r_GlideFormSetValue_String_String
The oldValues parameter of the onCellEdit method contains the previous values of the field being edited.
Does this help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2020 11:32 PM
Hi Adriantoth,
Thank you for the reply.
I tried with GlideForm setValue(), but it is not working as the method works on form view.
Regards,
Tejaswini.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2020 11:22 PM
Hi Tejaswini,
Very less documentation is available for onCellEdit
better for such type of scenario use before update business rule it would work when you edit something in list as well
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
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
01-06-2020 11:33 PM
Hi Ankur,
Thank you for the reply. this was helpful.
Regards,
Tejaswini.