Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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 

5 REPLIES 5

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

_____
100 % GlideFather experience and 0 % generative AI

Ankur Bawiskar
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  ||  10x 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  ||  10x 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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader