Erase a field value when a read only date field changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2025 11:30 PM
Hi All,
I want to erase existing values from a field when a date field changes but the date field is ready only in form view . What should be the correct approach to do this .
Please advise.
Thank You
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2025 11:32 PM
you can use before update business rule and clear the value
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2025 11:40 PM
Sorry, forgot to mention that field should be erased after the date changes . So if I follow business rule , could you please let me know what should be the script be like ? And is there any possibility to achieve this via any other method ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2025 11:50 PM
so user changes date field and other field needs to be cleared?
I didn't get your question, if date field is readonly on form then how the user is changing?
Is it getting changed from backend logic i.e. server side? if yes then in same script add logic to clear the other fields
if not then why not write onChange client script and use g_form.clearValue()
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 12:11 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader