Skip to content

Instantly share code, notes, and snippets.

View britishboyindc's full-sized avatar

Peter Churchill britishboyindc

View GitHub Profile
<apex:page controller="DemoController" applyHtmlTag="false" showHeader="false" lightningStylesheets="true" sidebar="false">
<html>
<body>
<apex:form >
<apex:slds />
<div class="slds-grid">
<div class="slds-col">
<apex:panelGrid columns="1" width="100%">
<apex:pageBlock mode="Account">
<apex:pageBlockSection title="Section 1" columns="1" collapsible="true">
public without sharing class CongressLookupUtility {
public kweos__EOCS_Data__c c {get;set;}
public kweos__EOCS_Data__c processedc {get;set;}
public String cDistrict {get;set;}
public List<Contact> kwcontacts {get;set;}
public CongressLookupUtility() {
c = new kweos__EOCS_Data__c();
}
Pushed 0/1 components to ebikes-lwc in 14 s 30 ms with status 1.
Failures
========
• LightningComponentBundle/null: ERROR at line 1, column 1 - LWC1078: <p> has no matching closing tag.
<template>
<template if:true={opportunity}>
{myAmount}
</template>
</template>
import { LightningElement,api, wire } from 'lwc';
import { getRecord } from 'lightning/uiRecordApi';
@britishboyindc
britishboyindc / LEX Form with p tag
Created June 14, 2019 13:01
LWC that won't deploy
<template>
<lightning-card title="Hello">
<lightning-button label="New" slot="actions"></lightning-button>
<p class="slds-p-horizontal_small">
<lightning-record-view-form record-id={recordId} object-api-name="Account">
<div class="slds-grid">
<div class="slds-col slds-size_1-of-2">
<lightning-output-field field-name="Name"></lightning-output-field>
<lightning-output-field field-name="Phone"></lightning-output-field>
</div>
@britishboyindc
britishboyindc / loggedinusertestclass
Last active March 14, 2019 22:52
Logged in User Test Class
@isTest
public class CommunityController_TEST {
@isTest
private static void testContactUser() {
//You'll need to use an actual Profile name in your org
Id p = [select id from profile where name='Customer Community User'].id;
Account ac = new Account(name ='Test Community One') ;
insert ac;
<apex:page standardController="Opportunity" >
<apex:outputPanel>
<apex:outputText>Thanks!</apex:outputText>
<br/>
<apex:outputField value="{!opportunity.Amount}"/> <br/>
<apex:outputField value="{!opportunity.CloseDate}"/> <br/><br/>
<apex:outputLabel>Household</apex:outputLabel><br/>
<apex:outputField value="{!opportunity.Account.Name}"/><br/>
<br/>
@britishboyindc
britishboyindc / gist:a9999e87e659612633406d28bd5ab157
Created February 28, 2017 18:27
Apex ZDM Lookup for Contact
//Instantiate Contact and include KW Fields on object
Contact c = new Contact();
//Set Address
c.MailingStreet = '4205 Cordobes Cv';
c.MailingCity = 'San Diego';
c.MailingState = 'CA';
c.MailingPostalCode = '92130';
//KW Fields (populate if already processed contact)
c.kwzd__KW_Error_Code__c = '';
c.kwzd__Latitude__c = NULL;
//Assume Asset object has name, lookup to user and picklist called Category
//Store results in a map
Map <String, List<String> > assetmap = new Map <String, List<String> >();
//Loop through assets
for (Asset__c tempasset : [Select Name, Category__c FROM Asset__c WHERE User__c = '0053000000AD9YT'] ) {
List<String> tempassetlist;
//if map already contains category, add to existing list
If (assetmap.containskey(tempasset.Category__c) ){
tempassetlist = assetmap.get(tempasset.Category__c);
}
trigger Employee_Demo on Employee__c (after insert, after update) {
//Create a map of the leaves for each Gender/Status Combo. Consider a setting for this
Map<String, List<String> > LeaveTypeMap = new Map<String, List<String> > ();
LeaveTypeMap.put('Female:Full Time', new List<String>{'Maternity Leave','Annual Leave','Personal Leave','Unpaid Leave'});
LeaveTypeMap.put('Male:Full Time', new List<String>{'Paternity Leave','Annual Leave','Personal Leave','Unpaid Leave'});
LeaveTypeMap.put('Female:Part Time', new List<String>{'Unpaid Leave'});
LeaveTypeMap.put('Male:Part Time', new List<String>{'Unpaid Leave'});
//Create list to hold new leave records
List<Leave__c> LeavestoCreate = new List<Leave__c> ();
//Is this an insert? If so, just create records