This file contains hidden or 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
public class Loader { | |
public static Map<Id, Account> acountIdToRecordMap { | |
get { | |
if (acountIdToRecordMap == null) { | |
acountIdToRecordMap = new Map<Id, Account> ([Select Name from Account]); | |
} | |
return acountIdToRecordMap; | |
} | |
private set; | |
} |
This file contains hidden or 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
/*** Apex version of the default logic. | |
* If opportunity's assigned account is assigned to | |
* Case 1: 0 territories in active model | |
* then set territory2Id = null | |
* Case 2: 1 territory in active model | |
* then set territory2Id = account's territory2Id | |
* Case 3: 2 or more territories in active model | |
* then set territory2Id = account's territory2Id that is of highest priority. | |
* But if multiple territories have same highest priority, then set territory2Id = null | |
*/ |
This file contains hidden or 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
public with sharing class QuoteApprovalController { | |
private SBQQ__Quote__c sbQuote; | |
ApexPages.StandardController qtController; | |
public SBAA__Approval__c[] approvals { | |
get { | |
if (approvals == null) { | |
approvals = SBAA.ApprovalAPI.preview( | |
sbQuote.Id, | |
SBAA__Approval__c.Quote__c | |
); |
OlderNewer