Skip to main content
({
    doInit : function(component, event, helper) {
        helper.loadAffiliations(component, event);
    },
    editAffiliation : function(component, event, helper) {
        helper.editRecord(component, event);
    }
})

})

({
    loadAffiliations : function(cmp, ev) {
        var action = cmp.get("c.getAffiliations");
        action.setParams({
            "currentId": cmp.get("v.curRecordId")
        });
        action.setCallback(this, function(response) {
            var state = response.getState();
            if(state === "SUCCESS") {
                var affiliations = response.getReturnValue();
                cmp.set('v.numAf', affiliations.length);
                cmp.set('v.afList', affiliations);
            }
            else if (state === "ERROR") {
                console.log('errors', response.getError());
            }
        });
        $A.enqueueAction(action);
    },
    editRecord : function(cmp, ev) {
        var row = cmp.getEvent("editAffiliation");
        console.log('row', row);
    }
})

})

console.log('row', row);console.log('row', row); logs out as nullnull.

({
doInit : function(component, event, helper) {
    helper.loadAffiliations(component, event);
},
editAffiliation : function(component, event, helper) {
    helper.editRecord(component, event);
}

})

({
loadAffiliations : function(cmp, ev) {
    var action = cmp.get("c.getAffiliations");
    action.setParams({
        "currentId": cmp.get("v.curRecordId")
    });
    action.setCallback(this, function(response) {
        var state = response.getState();
        if(state === "SUCCESS") {
            var affiliations = response.getReturnValue();
            cmp.set('v.numAf', affiliations.length);
            cmp.set('v.afList', affiliations);
        }
        else if (state === "ERROR") {
            console.log('errors', response.getError());
        }
    });
    $A.enqueueAction(action);
},
editRecord : function(cmp, ev) {
    var row = cmp.getEvent("editAffiliation");
    console.log('row', row);
}

})

console.log('row', row); logs out as null.

({
    doInit : function(component, event, helper) {
        helper.loadAffiliations(component, event);
    },
    editAffiliation : function(component, event, helper) {
        helper.editRecord(component, event);
    }
})
({
    loadAffiliations : function(cmp, ev) {
        var action = cmp.get("c.getAffiliations");
        action.setParams({
            "currentId": cmp.get("v.curRecordId")
        });
        action.setCallback(this, function(response) {
            var state = response.getState();
            if(state === "SUCCESS") {
                var affiliations = response.getReturnValue();
                cmp.set('v.numAf', affiliations.length);
                cmp.set('v.afList', affiliations);
            }
            else if (state === "ERROR") {
                console.log('errors', response.getError());
            }
        });
        $A.enqueueAction(action);
    },
    editRecord : function(cmp, ev) {
        var row = cmp.getEvent("editAffiliation");
        console.log('row', row);
    }
})

console.log('row', row); logs out as null.

added 154 characters in body
Source Link
Evan S.
  • 81
  • 2
  • 7

Originally my approach was just to pull the indexVar and then I'd be set but that's when I started finding out that none of the old ways worked anymore.

Originally my approach was just to pull the indexVar and then I'd be set but that's when I started finding out that none of the old ways worked anymore.

added 5647 characters in body
Source Link
Evan S.
  • 81
  • 2
  • 7
Loading
Source Link
Evan S.
  • 81
  • 2
  • 7
Loading