We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Record producer - category/subcategory

gnunez
Kilo Guru

Hello all,

I created a record producer for users to report issues with our enterprise applications. 

At first I only had one category and a list of subcategories so the form was working fine, but now that our requirement is to add multiple categories and multiple dependent subcategories it no longer is working. 

Since these subcategories are not listed in the oob incident form, I can't get the subcategories to be dependent on the category. 

I have seen a couple of threads that suggest creating a catalog client script, but if this is the way to go not sure what variable type the category/subcategory fields should be.

If anyone has suggestions or guidance they would be greatly appreciated!!

Thanks in advance!

Grace

8 REPLIES 8

peterh_smith
Tera Contributor

Switch to the Advanced view to see the tab.

SD29
Tera Expert

Hi,

The dictionary dependent value doesn't work in Catalog items. you have to use an onChange client script on the category field and make sure the client script UI Type is selected as "ALL" to run the script in Portal. 

The Variable type should be a select box.

Sample script : 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
g_form.clearOptions('sub_category');
return;
}

var cat=g_form.getValue('category');
if (cat=='abc'){
g_form.clearOptions('sub_category');

g_form.addOption('sub_category','','--None--');
g_form.addOption('sub_category','value', 'label');
}

else if (cat=='bbc'){
g_form.clearOptions('sub_category');
g_form.addOption('sub_category','','--None--');
}

}

 

Thanks,

SD

Thanks for the response SD.

This is a record producer so wouldn't it be different than a catalog item? Also, I tried adding the client script but there isn't a place to specify what cat item/record producer it should be applied to see below.

I also replaced your placeholders but not sure if I'm doing it correctly...

find_real_file.png