How to add if statement and call script include in advanced reference qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 07:44 AM
Hello,
my requirement is to add If statement and call script include in advanced reference qualifier.
there is a field called "Project/Demand" on cost plan table, which refers to task table and i need to provide if condition on one the fields if record is taken from demand or project record based on "Project/Demand" field.
if anyone can help me on this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 07:57 AM
You need something like this
//Option 1
javascript: if(current.getValue("FIELD") == "SOMETHING") { "SOME_REF_QUAL" } else { "SOMETHING_ELSE"; }
//Option 2 - usually this is the best option
javascript:(new refQualUtil()).getMyRefQual(current)
//Script include - make sure its Client Callable is checked
var refQualUtil = Class.create();
refQualUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getMyRefQual: function(current){
var filter = "";
//Do your work here to figure out what the filter should be
return filter;
},
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 08:46 AM
hi,
if(current.getValue(task)=='dmn_demand'){new CostTypeFilter().costValue(current.task.portfolio)} else {new CostTypeFilter().costValue(current.task.primary_portfolio);}
is this correct?
i need to check if current task field is holding the value from "dmn_demand" table or "pm_project" table