How to populate fields using url
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2024 09:58 AM
Hi,
This is my instance url for the 'Create Incident' record producer in the portal. How can I populate the fields service_offering and business_service using the url?
http://my_instance_url/esc?id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2024 10:43 AM
Share me what did you try and whats your business requirement ?
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2024 11:00 AM
Hi @Alon Grod ,
You can add in url like this. Replace with original sysids if reference.
http://my_instance_url/esc?id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9&sysparm_service=435bjkhb435kjb5kjb43jkb5kj4&sysparm_business=j5bj345jkjk32kjlnb2j3pojkh23gf;
& with onload client script you can populate
function onLoad(){
var url = top.location.href;
var userName = new URLSearchParams(url).get("sysparm_service");
var userEmail = new URLSearchParams(url).get("sysparm_business");
g_form.setValue('service_offering',sysparm_service);
g_form.setValue('business_service',sysparm_business);
}