Skip to content

Instantly share code, notes, and snippets.

Mark Masterson madmax983

Block or report user

Report or block madmax983

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@madmax983
madmax983 / CMTService.cls
Last active Aug 17, 2018
Apex Stub API with Static Methods
View CMTService.cls
public with sharing class CMTService {
public List<CMTWrapper> getCMTs() {
List<CMTWrapper> cmtWrappers = new List<CMTWrapper>();
List<CMT__mdt> cmts = [SELECT Example_Field_1__c, Example_Field_2_c FROM CMT__mdt];
for(CMT__mdt c : cmts) {
CMTWrapper cmtWrapper = new CMTWrapper(c.Example_Field_1__c, c.Example_Field_2__c);
cmtWrappers.add(cmtWrapper);
}
return cmtWrappers;
View lightningInputFieldExample.cmp
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:hasSobjectName" access="global" >
<lightning:recordEditForm recordId="{!v.recordId}" objectApiName="{!v.sObjectName}">
<lightning:messages />
<lightning:inputField fieldName="Name" />
<lightning:inputField fieldName="<INSERTNAMESPACEHERE>__LookupField__c" />
<lightning:button class="slds-m-top_small" variant="brand" type="submit" name="update" label="Update" onclick="{!c.handleClick}" />
</lightning:recordEditForm>
</aura:component>
@madmax983
madmax983 / MCVE_Dynamic.cmp
Last active Nov 16, 2016
Issues With Force:Input/OuputField
View MCVE_Dynamic.cmp
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:attribute name="record"
type="Opportunity"
default="{ 'sobjectType': 'Opportunity' }"/>
<aura:attribute name="error"
type="String"/>
<aura:attribute name="columns"
type="integer"
description="The number of columns"/>
<aura:attribute name="fields"
@madmax983
madmax983 / ltngDataServiceFun.cmp
Last active Oct 28, 2016
Fun with Lightning Data Service
View ltngDataServiceFun.cmp
<aura:component >
<aura:attribute name="recordIds"
type="List"
access="public"
description="An array of Ids"/>
<aura:attribute name="records"
type="Map"
description="The records!"
default="{}"/>
<aura:attribute name="errors"
You can’t perform that action at this time.