- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2017 05:11 PM
Hi everyone,
I am trying to create a field on a category table and want to reference the default value of that field on a HR case table
For example:
Sub Category Value is REP1 for Category called Data/Report Request
I would like REP1 to populate on the HR case form when the Category Data/Report Request is selected.
Any Ideas on how i can achieve this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2017 07:49 PM
Hi Karan,
Below script should actually work and shouldn't change the value back to the previous one. Can you put some alert as below?
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
else if(newValue != oldValue){
alert('newValue is '+newValue);
var category = g_form.getReference('u_category', populateSubCategory);
}
function populateSubCategory(category) {
g_form.setValue("u_sub_category",category.u_sub_category);
}
}
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2017 07:49 PM
Hi Karan,
Below script should actually work and shouldn't change the value back to the previous one. Can you put some alert as below?
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
else if(newValue != oldValue){
alert('newValue is '+newValue);
var category = g_form.getReference('u_category', populateSubCategory);
}
function populateSubCategory(category) {
g_form.setValue("u_sub_category",category.u_sub_category);
}
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2017 06:33 AM
Thanks Sanjiv, turns out there was a business rule that was updating the value to default, i have disabled it and its working fine. Thanks a bunch for your help