Skip to main content
Nintex Community Menu Bar


Hi All,

I’ve also been trying to edit this snippet, to no avail. My use case:

  • Two different objects, both with a multipicklist that uses a global picklist

  • If I filter object A, I want object B to also filter


My code is below, where the two models in Skuid are named ‘Projects’ and ‘Focus_Area_Grouping’. The model is named "Focus_Area_Grouping’ in both objects.

var $ = skuid.$,    Projects = skuid.$M(‘Projects’),
    Focus_Area_Grouping = skuid.$M(‘Focus_Area_Grouping’);
    
    $.each(Projects.conditions, function(i,condition){
        
        var agConditionName = condition.name,
            Focus_Area_Groupings__c = Focus_Area_Grouping.getConditionByName(Focus_Area_Groupings__c);

        if(condition.inactive) {
            Focus_Area_Grouping.deactivateCondition(Focus_Area_Groupings__c);
        } else {
            Focus_Area_Grouping.activateCondition(Focus_Area_Groupings__c);
            Focus_Area_Grouping.setCondition(Focus_Area_Groupings__c,condition.value);
        }

    });


Additionally, I also tried this:
var $ = skuid.$, Projects = skuid.$M(‘Projects’),Focus_Area_Grouping = skuid.$M(‘Focus_Area_Grouping’);

$.each(Projects.conditions, function(i,condition){

var agConditionName = condition.name,
basicCondition = Focus_Area_Grouping.getConditionByName(agConditionName);
if(!agConditionName) {
return true;
} else if(condition.inactive) {
Focus_Area_Grouping.deactivateCondition(basicCondition);
} else {
Focus_Area_Grouping.activateCondition(basicCondition);
Focus_Area_Grouping.setCondition(basicCondition,condition.value);
}


Any help welcome!


If you’re only dealing with one condition, you don’t need the ‘$.each’.

Try something like this…


var $ = skuid.$, &nbsp; &nbsp; Projects = skuid.$M('Projects'),<br>&nbsp; &nbsp; Focus_Area_Grouping = skuid.$M('Focus_Area_Grouping');<br>&nbsp; &nbsp;&nbsp;<br>var projectsCondition = Projects.getConditionByName('Focus_Area_Grouping'),<br>&nbsp; &nbsp; focusAreaGroupingCondition = Focus_Area_Grouping.getConditionByName('Focus_Area_Grouping');<br>&nbsp; &nbsp; if(projectsCondition.inactive) {<br>&nbsp; &nbsp;Focus_Area_Grouping.deactivateCondition(focusAreaGroupingCondition);<br>} else {<br>&nbsp; &nbsp;Focus_Area_Grouping.setCondition(focusAreaGroupingCondition, projectsCondition.value);<br>}