Aura Methods: [ bulkInsert, bulkUpdate, bulkDelete ]
// In cmp
<c:DML sObjectType="Contact" aura:id="dmlUtil" />
// In Controller/Helper js
cmp.find("dmlUtil").bulkInsert(recs, (result) => {
// result.error -> String
// result.records -> array of objects
});
<aura:attribute name="inActive" type="Boolean" default="false" />
<c:FeatureSetting Name="Feature Name" inActive = "{!v.inActive}" />
<aura:if isTrue="{!!v.inActive}">
<!-- Feature Code -->
</aura:if>
// In cmp
<c:Logger aura:id="logger" />
// In Controller/Helper js
cmp.find("logger").log({"Status" : "Query Successful"}, "success", <optional external logging - true by default>);
For Simple Queries only.
// In cmp
<c:SoqlUtil aura:id="soql" />
// In Controller/Helper js
cmp.find("soql").query(
"SELECT Id, FirstName, LastName FROM Contact Where CreatedDate = TODAY",
function(result){
console.log(result);
}
);
Code Snippet [For Hands-On]
<aura:component extends="c:SheildDashBoard" implements="flexipage:availableForAllPageTypes" access="global">
<div class="slds-m-around_large">
<span class="slds-badge">Total : {!v.total} </span> <br/> <br/>
<span class="slds-badge">Combat Unit : {!v.combat} </span> <br/> <br/>
<span class="slds-badge">Black-Ops : {!v.blackOps} </span>
</div>
</aura:component>