making dependent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 05:20 AM - edited 11-01-2023 10:52 PM
We have created 2 fields both are reference field.
Parent (L1) |
Name (l2) |
Now The Requirement is
L2 Commodity code depends on L1. If you choose any L1 on the children of that L1 should be available to choose in the L2 reference field.
We have excel too
Suppose if we are selecting from L1 Advertising & Marketing so From L2 field only below option should be available to chose .
How do i achieve this ...Please help me on the same
Many thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 05:44 AM
Hi @Pramod5 ,
You can use below script in reference qualifier of "Name (l2)":
javascript: getNames(current.variables.parent_l1); //Filter "Name (l2)" based on Parent (L1) selected
function: getNames(parent){
var name_arr = [];
var name = new GlideRecord("table name where Name (l2) stored");
name.addQuery("Parent (L1) ",parent); //Replace "Parent (L1)" with field name used in glided table
name.query();
while(name.next()){
name_arr.push(name.name_l2.toString()); //Replace "name_l2" with field name used in glided table
}