- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2017 11:27 AM
how to buid a URL for prefilling a field value for one record producer.
I have one variable called 'user name' in record producer.
I have a URL for that record producer. As per my requirement whenever a new user is created in the system, it sends a notification which contains a URL to that record producer. Now when I click on this URL it should prepopulate a variable called user name with the a new user created.
Could you please help me achieving this requirement.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2017 02:58 PM
Well, you need to put in a parameter in the url to have the sys_id of the user.. like this, here I added sysparm_caller
Then you need a onLoad Catalog client script that puts that info into the variable.. in this case I'm putting it into a variable called "caller_id"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2017 12:29 PM
Reference field actually mattered.. I didn't make it a reference field...
So, now I was able to populate a value with the help of a reference field when analyzing the whole process again. Only with the help of client script I was able to achieve this.
However, I have a second field value called 'location' which I am trying to populate for the same user. The location field is not a reference field. its a string.
I have tried both onLoad script and change script but the location field is not populating. Here is my code.
function onLoad() {
//Type appropriate comment here, and begin script below
alert("abc");
var userobject = g_form.getReference('u_name');
g_form.setValue('location',userobject.u_locations);
alert(userobject.u_locations);
}
//Here u_name is the input value for the user id from the sys_user table
I also tried this for onChange
function onChange(control, oldValue, newValue, isLoading) {
// if (isLoading || newValue == '') {
// return;
// }
//Type appropriate comment here, and begin script below
alert("abc");
userobject = g_form.getReference('u_name');
g_form.setValue('location','userobject.u_locations');
alert('userobject.u_locations');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2017 12:17 PM