Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Is it possible to use g_form in oncell edit client scripts

MaharshiC
Tera Contributor

Hi,

 

Is it possible to use g_form for oncell edit client scripts? If it is not possible how to check for values in other fields for the request using oncelledit?

 

 

10 REPLIES 10

Dr Atul G- LNG
Tera Patron

Hi @MaharshiC 

 

oncell edit only works on the list view, mate. You’ll need to apply validation to the other fields."

****************************************************************************************
Regards
Dr Atul G. - Learn N Grow Together ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
******************************************************************************************

Hi @Dr Atul G- LNG ,

 

Thank you  for your answer. How do we do validation in that case . can we do through the celledit client script ?

Hi @MaharshiC 

 

Are you referring to validation on one field or multiple fields? If it's just one field, then oncell edit is available. However, if it's for other fields, you can follow Ankur’s suggestion using g_scratchpad."

https://youtu.be/TgZbATLoS04

****************************************************************************************
Regards
Dr Atul G. - Learn N Grow Together ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
******************************************************************************************
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.

Samrudhi Pandi1
Tera Contributor

It is not possible to use g_form in onCellEdit client scripts since it works on the list view.

However you can make a server-side call using script include and GlideRecord or g_scratchpad to check other field values.