This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*************************************************************************************************** | |
* Copyright (c), FinancialForce.com, inc | |
* All rights reserved. | |
* | |
* Generic Query Builder class to handle generation of SOQL queries and query exection | |
* based on fflib QueryFactory | |
***************************************************************************************************/ | |
public class QueryBuilder { | |
public enum SortOrder {ASCENDING, DESCENDING} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Parent component "parent.cmp" --> | |
<aura:component> | |
<aura:attribute name="myAttr" type="String" default="world" /> | |
<c:child myAttrChild="{!v.myAttr}"> | |
</aura:component> | |
<!-- Child component "child.cmp" --> | |
<aura:component> | |
<aura:attribute name="myAttrChild" type="String"/> | |
<lightning:input name="input1" label="Enter some text" value="{!myAttrChild}" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var allCheckboxes = document.querySelectorAll("input[type=checkbox]"); | |
Array.from(allCheckboxes).forEach( | |
function(thisCheckbox) { | |
thisCheckbox.checked = true; | |
} | |
); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A good approach to follow for trigger development | |
Any trigger's logic can be looked at in three parts(as below) and the code for that should also be written based on those parts: | |
1. Trigger event detection | |
This should go in the trigger where we write logic for trigger event detection and delegation to appropriate method in handler class. | |
2. Record filtering | |
Record filtering can be done using a separate class which can have different methods for filtering for each action. It may happen that a filter can be applied to two different actions, for which we can reuse the same method for filtering. | |
3. Actions (Business logic) | |
This should be typically done in a service class. The records filtered in step #2 can be passed on to the service class to perform actions like creating child records, updating parent record, etc on them. |