
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 01:08 AM
Hi All,
I have below script include which I want to use in two different reference qualifier. It is not working, Can anyone help me out what's wrong in below script include.
var GetDepList = Class.create();
GetDepList.prototype = {
initialize: function(organizationLevel) {
this.organizationLevel = organizationLevel;
},
returnDepQuery: function() {
var filterString = "";
if (this.organizationLevel) {
filterString = 'parent=' + this.organizationLevel + '^u_active=true^correlation_idISNOTEMPTY';
} else {
filterString = 'u_active=true^correlation_idISNOTEMPTY';
}
return filterString;
},
type: 'GetDepList'
};
// for (level_2_organization)
var depLevel2 = new GetDepList(current.variables.level_1_organization);
// Reference qulif I used: javascript:depLevel2.returnDepQuery();
//for (level_3_organization)
var depLevel3 = new GetDepList(current.variables.level_2_organization);
//Reference qulif I used: javascript:depLevel3.returnDepQuery();
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 01:45 AM
Hi @Community Alums,
Use the reference qualifiers as provided below.
If you run into an issue, please let me know.
var GetDepList = Class.create();
GetDepList.prototype = {
initialize: function(organizationLevel) {
this.organizationLevel = organizationLevel;
},
returnDepQuery: function() {
var filterString = "";
if (this.organizationLevel) {
filterString = 'parent=' + this.organizationLevel + '^u_active=true^correlation_idISNOTEMPTY';
} else {
filterString = 'u_active=true^correlation_idISNOTEMPTY';
}
return filterString;
},
type: 'GetDepList'
};
//for (level_1_organization)
//Reference qulif I used: javascript: new GetDepList(current.variables.level_1_organization).returnDepQuery();
// for (level_2_organization)
// Reference qulif I used: javascript: new GetDepList(false).returnDepQuery();
//for (level_3_organization)
//Reference qulif I used: javascript: new GetDepList(current.variables.level_2_organization).returnDepQuery();
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 01:16 AM
Hi @Community Alums
Can you please elaborate some more about your requirements, and what is exactly not working.
To get you started, I corrected some points in your script.
var GetDepList = Class.create();
GetDepList.prototype = {
initialize: function(organizationLevel) {
this.organizationLevel = organizationLevel;
},
returnDepQuery: function() {
var filterString = "";
if (this.organizationLevel) {
filterString = 'parent=' + this.organizationLevel + '^u_active=true^correlation_idISNOTEMPTY';
} else {
filterString = 'u_active=true^correlation_idISNOTEMPTY';
}
return filterString;
},
type: 'GetDepList'
};
// for (level_2_organization)
// Reference qulif I used: javascript: new GetDepList (false).returnDepQuery();
//for (level_3_organization)
//Reference qulif I used: javascript: new GetDepList (current.variables.level_2_organization).returnDepQuery();
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 01:26 AM - edited 09-18-2023 01:35 AM
Hi @Peter Bodelier ,
I have two different script include both's are working fine, so I want to merge them into one
1st Script include
var GetDepList = Class.create();
GetDepList.prototype = {
initialize: function() {},
returnDepQuery: function() {
newValue = current.variables.level_2_organization;
var filterString = "";
if (newValue)
filterString = 'parent=' + current.variables.level_2_organization + '^u_active=true^correlation_idISNOTEMPTY';
else if (newValue == "")
filterString = 'u_active=true^correlation_idISNOTEMPTY';
return filterString;
},
type: 'GetDepList'
};
//In reference qualifier of the variable put javascript;new GetDepList().returnDepQuery();
2nd script Include
var GetDepList1= Class.create();
GetDepList1.prototype = {
initialize: function() {
},
returnDepQuery: function() {
newValue = current.variables.level_1_organization;
var filterString = "";
if (newValue)
filterString = 'parent=' + current.variables.level_1_organization + '^u_active=true^correlation_idISNOTEMPTY';
else if (newValue == "")
filterString = 'u_active=true^correlation_idISNOTEMPTY';
return filterString;
},
type: 'GetDepList1'
};
//In reference qualifier of the variable put javascript;new GetUserList1().returnDepQuery();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 01:45 AM
Hi @Community Alums,
Use the reference qualifiers as provided below.
If you run into an issue, please let me know.
var GetDepList = Class.create();
GetDepList.prototype = {
initialize: function(organizationLevel) {
this.organizationLevel = organizationLevel;
},
returnDepQuery: function() {
var filterString = "";
if (this.organizationLevel) {
filterString = 'parent=' + this.organizationLevel + '^u_active=true^correlation_idISNOTEMPTY';
} else {
filterString = 'u_active=true^correlation_idISNOTEMPTY';
}
return filterString;
},
type: 'GetDepList'
};
//for (level_1_organization)
//Reference qulif I used: javascript: new GetDepList(current.variables.level_1_organization).returnDepQuery();
// for (level_2_organization)
// Reference qulif I used: javascript: new GetDepList(false).returnDepQuery();
//for (level_3_organization)
//Reference qulif I used: javascript: new GetDepList(current.variables.level_2_organization).returnDepQuery();
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.