cross model linked conditions

  • 5
  • Idea
  • Updated 4 years ago
  • Implemented
Photo of Pat Vachon

Pat Vachon, Champion

  • 46,404 Points 20k badge 2x thumb

Posted 5 years ago

  • 5
Photo of Pat Vachon

Pat Vachon, Champion

  • 46,404 Points 20k badge 2x thumb
Official Response
The javascript snippet to enable this was relatively easy.

var $ = skuid.$,
    eliteAgentAccounts_Ag = skuid.$M('EliteAgentAccounts_Ag'),
    eliteAgentAccounts_Basic = skuid.$M('EliteAgentAccounts_Basic');
    
    $.each(eliteAgentAccounts_Ag.conditions, function(i,condition){
        
        var agConditionName = condition.name,
            basicCondition = eliteAgentAccounts_Basic.getConditionByName(agConditionName);

        if(condition.inactive) {
            eliteAgentAccounts_Basic.deactivateCondition(basicCondition);
        } else {
            eliteAgentAccounts_Basic.activateCondition(basicCondition);
            eliteAgentAccounts_Basic.setCondition(basicCondition,condition.value);
        }

    });