Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How can we do this

Abdul
Tera Contributor

i have a reference field in my catalog item which gets the data from cmn_department table.

Whenever a user selects certain department the location field should automatically be populated.  Also this has to be auto populated only when project type is renewal, which is a dropdown field 

How can we do this effieciently.

For eg if the user selects -> 1234 North Atlantic as department then the location field should be populated as Atlantic. 

Would client script work or we have to do with glide ajax?

 

Thanks 

3 REPLIES 3

GlideFather
Tera Patron

Hi @Abdul,

 

the behaviour that you described will need two scripts:

  • to reflect the change in the Department field
    • onChange client script for native UI (backend),
    • onChange catalog client script for Portal or ESC,
      • if you want both UIs then both scripts are needed
    • function in a script include
      • can be re-used for both CS and CCS if used properly

You can get inspiration from this: GlideAjax Example Cheat Sheet (UPDATED)

 

Let me know how does it go

_____
This reply is 100 % GlideFather and 0 % AI

Ankur Bawiskar
Tera Patron
Tera Patron

@Abdul 

you can use onChange client script + getReference callback or GlideAjax for this

what did you start with and where are you stuck?

GlideAjax Example Cheat Sheet (UPDATED) 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Abdul 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader