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 Controller | |
public with sharing class LWC_Methods { | |
@AuraEnabled(Cacheable=true) | |
public static String getPhotoId(String recordId) { | |
List<Id> contentids = new List<Id>(); | |
for (ContentDocumentLink cdl : [ | |
SELECT Id,ContentDocumentId | |
FROM ContentDocumentLink |
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: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"> |
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 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(); | |
} |
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
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. |
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
<template> | |
<template if:true={opportunity}> | |
{myAmount} | |
</template> | |
</template> | |
import { LightningElement,api, wire } from 'lwc'; | |
import { getRecord } from 'lightning/uiRecordApi'; |
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
<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> |
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
@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; | |
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: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/> |
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
//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; |
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
//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); | |
} |
NewerOlder