How to create dependent fields on a record producer?

jaubert
Tera Guru

Good Morning,

I have created a custom table within my instance that has two fields, category and subcategory.  Subcategory requires a dependency on the category field.  I just want to make sure I am correct with the info I have found.  This is not possible on a record producer without scripting, I can only set a field dependency on the table form.  Not sure that it matters, but the category and subcategory is not related to incidents, they are related to facility requests at our company.

1 ACCEPTED SOLUTION

Mark Manders
Mega Patron

Indeed, you need to script. Check this blog for more information.

If my answer helped you in any way, please then mark it as helpful.

Mark


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

View solution in original post

4 REPLIES 4

Mark Manders
Mega Patron

Indeed, you need to script. Check this blog for more information.

If my answer helped you in any way, please then mark it as helpful.

Mark


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

For the Lookup field table and value field would that be my "Subcategory" field on my table?

find_real_file.png

find_real_file.png

Also, is it safe to say the "subcategory" is my table name not the variable name.

hunterphillips
Tera Contributor

If you have your dependency defined on the sys_choice table, you shouldn't need a script

// Example: Incident

// Reference qualifier
javascript: 'name=incident^element=subcategory^inactive=false^dependent_value=' + current.variables.category

// Variable attributes
ref_qual_elements=category


https://www.servicenow.com/community/now-platform-forum/how-to-create-field-dependency-in-a-record-p...