Skip to content

Instantly share code, notes, and snippets.

@stephenbrown1
stephenbrown1 / VaultDocEventTrigger.apxt
Created September 4, 2017 22:48
Platform event trigger and test code
trigger VaultDocEventtrigger on Vault_Document__e (after insert) {
List<Vault_Doc__c> vdocsnew = new List<Vault_Doc__c>();
List<Vault_Doc__c> vdocsupd = new List<Vault_Doc__c>();
List<Decimal> docids = new List<Decimal>();
for(Vault_Document__e vEvent: trigger.New){
docids.add(vEvent.Doc_Id__c);
}
@stephenbrown1
stephenbrown1 / DiscountCalc.cmp
Created September 4, 2017 22:40
discount component bundle
<aura:component implements="force:hasRecordId,flexipage:availableForRecordHome,flexipage:availableForAllPageTypes"
access="global">
<aura:attribute name="record" type="Object" />
<force:recorddata aura:id="forceRecordData"
recordId="{!v.recordId}"
layoutType="FULL"
mode="EDIT"
recordUpdated="{!c.resetDiscountForm}"
@stephenbrown1
stephenbrown1 / vaultembed.cmp
Created September 4, 2017 22:33
Doc embed in Veeva Vault
<aura:component implements="force:hasRecordId,flexipage:availableForRecordHome,flexipage:availableForAllPageTypes">
<aura:attribute name="record" type="Object" />
<aura:attribute name="fieldMap" type="Object" />
<force:recorddata aura:id="accountrecord"
recordId="{!v.recordId}"
targetFields="{!v.record}"
fields="Id,Name,Doc_Token__c"
LayoutType="FULL"
@stephenbrown1
stephenbrown1 / gmaps.cmp
Last active September 4, 2017 22:25
gmaps lightning bundle
<aura:component implements="force:hasRecordId,flexipage:availableForRecordHome,force:hasSObjectName">
<aura:attribute name="record" type="Object" />
<aura:attribute name="fieldMap" type="Object" />
<aura:attribute name="mapslink" type="String" default=""/>
<force:recorddata aura:id="accountrecord"
recordId="{!v.recordId}"
targetFields="{!v.record}"
@stephenbrown1
stephenbrown1 / accGetExternalData.cmp
Created September 4, 2017 21:40
accGetExternalData.cmp
<aura:component implements="force:hasRecordId,flexipage:availableForRecordHome,force:hasSObjectName">
<aura:attribute name="record" type="Object" />
<aura:attribute name="fieldMap" type="Object" />
<force:recorddata aura:id="accountrecord"
recordId="{!v.recordId}"
targetFields="{!v.record}"
fields="Id,Name,Rating,External_Customer_ID__c,External_Customer_ID__r.CompanyName__c,External_Customer_ID__r.ContactName__c"
@stephenbrown1
stephenbrown1 / 1_LDS examples from DUDSE17
Last active September 4, 2017 21:37
My code examples from Downunder Dreaming Sydney on 29 Aug 2017
# my code examples from Downunder Dreaming Sydney on 29 Aug 2017
@stephenbrown1
stephenbrown1 / button_onclick_JS_run_joined_report
Last active April 29, 2019 14:13
Pass filter criteria to a joined report
var url = "/00O90000004ewmO"; // report ID
var method = "POST";
var idArray = {!GETRECORDIDS($ObjectType.Contract_Partner_vod__c)}; // if the field you want for report critiera isn't avail from the detail record (ie list button) then need to get related data
var idToUse = idArray[0];
//alert(idToUse);
if (idToUse == null) { // need to have at least 1 record selected
alert('You must select one contract partner record to run this report.');
} else {