- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2023 07:39 AM
Hi all!!
I need help with this advanced ref qual.
I have this already working: javascript:if (current.variables.wbs_territory != '') "company=" + new TerritoryUserUtils().getCompany(current.variables.wbs_territory)+"^active=true";
What I need it to do is if current.variables.wbs_territory is "CEE Region", the only condition has to be active=true.
I tried writing it this way:
javascript:if (current.variables.wbs_territory != '') "company=" + new TerritoryUserUtils().getCompany(current.variables.wbs_territory)+"^active=true";
else(current.variables.wbs_territory == 'CEE Region') "^active=true";
But currently the red part's not working.
Any help is very much appreciated!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2023 09:47 AM
Hello Magali Legaspi
if you first check for 'not is empty' only it will always do the instruction for the 'not is empty' condition as long as the variable is not empty. This means that even in case the value of variable is equal to 'CEE Region' it will run the Script Include that is called in the first condition for variable not is empty.
So you need to also add at least '&& current.variables.wbs_territory != 'CEE Region'' so it will only run the Script Include of the first condition if the variable is not empty and is not 'CEE Region'.
If it is 'CEE Region' then it will run into the else statement.
Hope this helps 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2023 09:38 AM
Try it this way:
javascript:if (current.variables.wbs_territory != '') "company=" + new TerritoryUserUtils().getCompany(current.variables.wbs_territory)+"^active=true";
else if(current.variables.wbs_territory == 'CEE Region') "active=true";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2023 09:47 AM
Hello Magali Legaspi
if you first check for 'not is empty' only it will always do the instruction for the 'not is empty' condition as long as the variable is not empty. This means that even in case the value of variable is equal to 'CEE Region' it will run the Script Include that is called in the first condition for variable not is empty.
So you need to also add at least '&& current.variables.wbs_territory != 'CEE Region'' so it will only run the Script Include of the first condition if the variable is not empty and is not 'CEE Region'.
If it is 'CEE Region' then it will run into the else statement.
Hope this helps 🙂