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
| // records populated | |
| List<SObject> records = ...; | |
| Set<Id> recordIds = new Map<Id, SObject>(records).keySet(); |
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
| global class Operation { | |
| global class OperationRequest { | |
| global String inputA { get; set; } | |
| global Boolean inputB { get; set; } | |
| // etc | |
| } | |
| global class OperationResponse { |
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 InterfaceExample { | |
| public interface A { | |
| void operationA(); | |
| } | |
| public interface B extends A { | |
| void operationB(); | |
| } | |
| } |
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 ColorExample { | |
| public enum Color { | |
| Red, | |
| Green, | |
| Blue | |
| } | |
| public void adjust(Color c) { | |
| if (c == color.Red) { | |
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
| // 1,000 Accounts already exist in org. | |
| List<Account> accounts = | |
| [Select Id | |
| from Account | |
| limit 1000]; | |
| // Determine how much time to collect account ids from list using for each loop | |
| DateTime fromListStart = DateTime.now(); | |
| Set<Id> accountIdsFromList = new Set<Id>(); |
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
| <aura:component controller="LookupDropdownController" | |
| implements="flexipage:availableForRecordHome,force:hasRecordId,force:hasSObjectName"> | |
| <aura:attribute name="lookupField" type="String" /> | |
| <aura:attribute name="lookupFieldLabel" type="String" /> | |
| <aura:attribute name="submitButtonLabel" type="String" default="Submit" /> | |
| <aura:attribute name="selectableRecords" type="List" /> | |
| <aura:attribute name="debugEnabled" type="String" /> | |
| <aura:handler name="init" value="{!this}" action="{!c.initLookupDropdown}" /> |
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
| <design:component> | |
| <design:attribute name="lookupField" label="Lookup Field" description="API Name of the lookup field." /> | |
| <design:attribute name="submitButtonLabel" label="Submit Button Label" default="Submit" description="The label to show on the submit button." /> | |
| <design:attribute name="debugEnabled" label="Debug Enabled" datasource="Yes,No" default="No" description="When set to Yes, the diagnostic information is shown." /> | |
| </design:component> |
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
| <design:component> | |
| <design:attribute name="lookupField" label="Lookup Field" description="API Name of the lookup field." /> | |
| <design:attribute name="submitButtonLabel" label="Submit Button Label" default="Submit" description="The label to show on the submit button." /> | |
| <design:attribute name="debugEnabled" label="Debug Enabled" datasource="Yes,No" default="No" description="When set to Yes, the diagnostic information is shown." /> | |
| </design:component> |
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
| ({ | |
| initLookupDropdown : function(component, event, helper) { | |
| var action = component.get("c.loadLookupDropdown"); | |
| var objectName = component.get("v.sObjectName"); | |
| var lookupField = component.get("v.lookupField"); | |
| var recordId = component.get("v.recordId"); | |
| console.log("objectName: " + objectName); | |
| console.log("lookupField: " + lookupField); | |
| console.log("recordId: " + recordId); | |
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 LookupDropdownController { | |
| @auraEnabled | |
| public static Context loadLookupDropdown(String objectName, String lookupField, Id recordId) { | |
| Context c = new Context(); | |
| String[] types = new String[]{ objectName }; | |
| Schema.DescribeSobjectResult[] results = Schema.describeSObjects(types); | |
| Schema.DescribeSobjectResult objectResult = results[0]; | |