Autopopulate fields in Service Catalog form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 05:40 AM
Im sure this is simple and i'm just overthinking it...
I have a form that points to specific hardware in the peripheral table (cmdb_ci_peripheral)
I want to do the following
Select Box - user selects the peripheral < this works
Then Autopopulate the following fields
MAC Address
Serial Number
IP Address
Looking at the table view my assumption is that the names are
mac_address , serial_number, ip_address
When I try and script this for onChange I am doing the following - any idea where I missed?
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 06:00 AM
Hi Brian,
I suggest you use GlideAJAX since getReference() is not a recommended practice anymore for retrieving data due to their performance impact.
This thread could guide you on how to retrieve the needed data from SN tables using GlideAJAX:
https://www.servicenow.com/community/developer-articles/glideajax-example-cheat-sheet/ta-p/2312430
Hope it helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 06:50 AM
Hi,
Is the field name correctly called in the script i.e., existing_unit_name?
Next - Onchange script based on what field selection the below code is running? did you verify it?
Suresh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 06:56 AM
Did you try with Auto Populate on variable?
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
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
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************