cross model linked conditions

  • 5
  • Idea
  • Updated 2 years ago
  • Implemented
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb

Posted 4 years ago

  • 5
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 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);
        }

    });