Friday, 28 December 2018

Salesforce Apex Hours :- 2018


Happy New Year !!!

"Salesforce Apex Hours" is a recurring event to talk about Salesforce! Its a online event. After completing successful sessions in 2017 . We are happy that we have completed 24 successful online events in 2018 on below given topics. 

 
1) Big Object 

In that session we talk about need of Big Object and Consideration for big object Usages with Live Demo. We also also talk about limitation with big object.

Speaker :- Jigar Shah.
Agenda  :-
  1. Need for Big Objects
  2. Consideration for Big Objects Usage
  3. Demo
  4. Limitations with using Big Objects
  5. Q&A
  6. Additional References
Here is recording of Session.

https://www.youtube.com/watch?v=gV1Oviqzry0&t=160s




2) Spring 18 Lightning Component Framework Updates 

In that session we talk about new component in Spring 18 (Carousel , inputfield, outputfield, input address,list view ,record Edit form , Tree grid) and Using of flows in Lightning components with live demo.

Speaker :- Mohith Shrivastava
Agenda  :-
  1. New Base Components (Carousel , inputfield,outputfield,input address,list view ,record Edit form , Tree grid)
  2. Using flows in lightning components
  3. Demo
  4. FAQ
Here is recording of Session.

https://www.youtube.com/watch?v=cfcaN26qntQ&t=120s


3) External Services Salesforce 

In that session we talk about use of External Services with live demo.

Speaker :- Shruti Sridharan
Agenda  :-
  1. Introduction to External Services (Beta)
  2. Demo
  3. FAQ
Here is recording of session.

https://www.youtube.com/watch?v=dpspn5sVbIU&t=190s


4) Lightning Testing Service (LTS) 

In that session we talk about what is Jasmine and how to use Jasmine. We also did the live coding for how to use LTS with Consideration for Lightning Testing Service.

Speaker :- Jitendra Zaa
Agenda :-
  1. What is Jasmine
  2. Demo of Simple Jasmine Application
  3. Other Frameworks
  4. Considerations for Lightning Testing Service
  5. Q&A
Here is recording of session.

https://www.youtube.com/watch?v=YGeJjDRiqMg&t=185s


5) Basics of Einstein Analytics

On Sat, MAR 24, 2018 we organized session on “Basics of Einstein Analytics“. In this session we talk about what is Einstein Analytics with Demo.

Speaker :- Jitendra Zaa
Agenda:-
  1. What is Einstein Analytics
  2. Terminology
  3. Importing Dataset
  4. Creating Lenses
  5. Creating Dashboard
  6. Dashboard Tips and Tricks
    1. Steps
    2. Cross-Dataset filter (Connect DataSet)
  7. Dataflow Performance Improvement
  8. View SAQL
Here is recording of session.

https://www.youtube.com/watch?v=4w-YKceeLSk&t=210s


6) SSIS integration with Salesforce

On Sat, April 14, 2018 we organized session on “SSIS integration with Salesforce“. In this Session we talk about what is ETL and SSIS. How to connect Salesforce with SSIS.

Speaker :- Jitendra Zaa
Agenda :-
  1. What is ETL
  2. Introduction to SSIS
  3. COZYROC Connector
  4. Connecting Salesforce with SSIS
  5. Simple CRUD Demo
  6. Download attachments
  7. Upload attachments
  8. SSIS best practices
    1. Logging
    2. Configuration
  9. Q&A
Here is recording of session.


https://www.youtube.com/watch?v=RA5azDuubU4&t=110s


7) Platform Event

On Sat, MAY 19, 2018 we organized session on “Integrating with Salesforce using Platform Events“ with Jiger.

Speaker :- Jigar Shah.
Agenda :-
  1. Point to Point Integration Challenges
  2. Solution – Event Driven Architecture
  3. Understanding Platform Events
  4. Publishing & Subscribing to Platform Events
  5. Demo
  6. Q & A
Here is recording of session.

https://www.youtube.com/watch?v=pjFERotMm7o&t=10s


https://www.youtube.com/watch?v=pjFERotMm7o&t=10s


8) MuleSoft

On March 20th Salesforce signed a definitive agreement to acquire MuleSoft. This was Salesforce's largest acquisition ever at $6.5B. In the future this will be powering Salesforce's Integration Cloud. In this session we talk about what is MuleSoft with live demo.

Speaker :-Shree Mandadi , Mike Samboy , Amit Chaudhary
Agenda:-
  1. Technology overlap (Salesforce / MuleSoft)
  2. An overview the MuleSoft ecosystem
  3. How knowing MuleSoft can help a Salesforce Developer
  4. Where will the opportunities be for Salesforce developers
  5. What happened at MuleSoft CONNECT 18, what is the buzz.
  6. Q & A
Here is recording of session.

https://www.youtube.com/watch?v=r78_aBw4QoY&t=492s


9) Einstein Bots

On Sat, MAY 19, 2018 we organized session on "Einstein Bots". If you want to configure the same in your developer org please check this post for step by step process.

Speaker :- Shruti Sridharan , Amit Chaudhary
Agenda :-
  1. What’s all the fuss about Einstein Bots ?
  2. What are my per-requisites ?
  3. What is it made up of – Dialog, Slots and Entities
  4. Let’s Build One!
  5. Things to Remember
  6. Q & A
Here is recording of session.

https://www.youtube.com/watch?v=Z2v0Dv6nWaI&t=103s


10) How Lightning Platform Query Optimizer works for LDV

That online event was focused on importance of Salesforce's Query Optimizer and how it can help to improve the performance when dealing with Large Data Volume.

Speaker :- Jitendra Zaa, Sudipta Deb

Here is recording of session.

https://www.youtube.com/watch?v=FtfZV5uf9fg&t=150s


11) Lightning Bolt Solution

In this recording we talk about how to create Lightning Bolt Solution. Please check this post for step by step process.

Speaker :- Amit Chaudhary

Here is recording of session.

https://www.youtube.com/watch?v=pl7XkZt7bUk&t=30s


12) Einstein Platform Services

In that session we talk about what is AI and Machine Learning and Ket Concepts of ML. Overview of Einstein platform.

Speaker :- Prajakta Samant , Amit Chaudhary
Agenda :-
  1. What is AI , Machine Learning and Deep Learning
  2. Key concepts of ML
  3. Overview of Einstein Platform Services
  4. Demo
  5. Key Takeaways
Here is recording of session.

https://www.youtube.com/watch?v=_5bhpeMCc5Y&t=116s


13) How to Test Rest API Using POSTMAN | OAuth2

In this recording we talk about how to test REST API using postman with step by step process.

Speaker :- Amit Chaudhary

Here is recording of session.

https://www.youtube.com/watch?v=WdAhD6p1nKM


14) Salesforce Community

We Created multiple recording for "How to setup Salesforce Community".

Speaker :- Amit Chaudhary

Here is List of Recording:-
  1. Setup Salesforce Community (Part 1)
  2. Content Layout in Salesforce Community (Part 2)
  3. Setup Communities Navigation Menu (Part 3)
  4. Page Variations and Audience in Salesforce Community (Part 4)
  5. Knowledge In Community (Part 5)
  6. Snap in Chat in Salesforce Community (Part 6 )
https://www.youtube.com/watch?v=bowKDMQOzHs&list=PLaGX-30v1lh0yjm8UbB-4smaykJzCsH2y




15) Salesforce Report REST API

On 25 Sept 2018, “Salesforce Apex Hours” organized another successful Online session / event on “Demystifying the Salesforce reports Api“.

Speaker :- Jigar Shah
Agenda  :-
  1. Why use the Salesforce Report API?
  2. Features & Capabilities
  3. Salesforce Report API Basics
  4. Demo
  5. Q & A
Here is recording of session.

https://www.youtube.com/watch?v=kJD4d2xhKGY&t=1s


16) Setup SoapUI to Test Salesforce Webservice

In this recording we talk about how to configure SoapUI to test Salesforce Webservice.
Speaker :- Amit Chaudhary

Here is recording of session.

https://www.youtube.com/watch?v=zPBqHjZFHf4&t=1s


17) Einstein Analytics (Part 1)

We Scheduled the two session on "Einstein Analytics" with Rikke Hovgaard and we talk about basic of Einstein , Compare tables, custom maps, Action and Embedding.

Speaker :-  Rikke Hovgaard
Agenda :-
  1. How does the platform work – overview and concepts
  2. Introduction to the UI
  3. Compare tables
  4. Custom Maps
  5. Actions
  6. Embedding
Here is recording of session.


https://www.youtube.com/watch?v=6WNwOQjYm5c&t=189s


18) Einstein Analytics part 2


We Scheduled the two session on "Einstein Analytics" with Rikke Hovgaard and we talk about DataFlow SAQL with compare table and SAQL.

Speaker :-  Rikke Hovgaard
Agenda  :-
  1. Replication and dataflow
  2. A few binding use cases
  3. SAQL with compare table
  4. SAQL example
  5. SOQL example
Here is recording of session.

https://www.youtube.com/watch?v=LLXIpuePs0Y&t=83s


19) Salesforce DX for Non-Scratch Org.

In this session we talk about how to setup VSCode with SalesforceDX for Non-Scratch org. Here is Blog post for same.

Speaker :- Mohith Shrivastava
Agenda :-
  1. Scratch Org VS Sandbox Development
  2. SalesforceDX source code format from traditional format
  3. Winter 19 Salesforce Source Commands (Retrieve, Deploy and Delete)
  4. Using Salesforce Extensions For VSCode against Non-scratch orgs
  5. Auto Generating package.xml from change sets and un-managed package
  6. Setting Developer Workflows for Salesforce application development and debugging (ISV apps and change set based development)
  7. Deploying metadata from one org to another using Vscode extensions
Here is recording of session.

https://www.youtube.com/watch?v=dfAX2ec9py8&t=100s


20) Azure Active Directory Seamless Single Sign-On with Salesforce .

In this session we talk about Single Sign-on. And we did the SSO with Azure Active Directory.

Speaker :- Amit Singh
Agenda  :-
  1. Single Sign On
    • Delegated Authentication
    • Federated Authentication (SAML)
  2. Identity Provider (IP)
  3. Service Provider (SP)
Here is recording of session:- 


https://www.youtube.com/watch?v=sTBfRVSg82o&t=90s

 

21) Heroku Connect Deep Dive.

On 24 NOV 2018, “Salesforce Apex Hours” organized another successful Online session / event on “An in-depth look into Heroku Connect“.

Speaker :- Shruti Sridharan
Agenda :-
  1. What Problem Are We Solving
  2. Say hello to Heroku Connect
  3. Why Heroku Connect is the Best Choice
  4. Heroku Connect Setup
    •         Establish Connection
    •         Setting up Mappings
    •         Sync Data from Salesforce to Heroku Postrges
    •         Sync Data from Heroku Postrges to Salesforce
  5. Visualize data in Heroku Postrges
    •         Using DBeaver
    •         Using Simple Node.js App
  6. Checklist: Things to Remember
  7. References
  8. Q & A
Here is recording of session :- 

https://www.youtube.com/watch?v=2NiddbVE38g&t=4s


22) Lightning Locker Services.

On Sat, DEC 15, 2018 we organized session on "Lightning Locker Services".

Speaker :- Manish Choudhari
Agenda :-
  1. What is Lightning Locker Service?
  2. Why there is a need for Lightning Locker?
         -- Why do we say that browsers can be insecure?
         -- What is malicious JavaScript?
         -- What is cross-site scripting(XSS)?
  3. How it impacts your Lightning Components?
  4. How you can enable/disable Lightning Locker
  5. Demo
Here is recording of session.

https://www.youtube.com/watch?v=F1vQ7BqdUc0&t=200s


23) Lightning Web Components (How to create first LWC).

In this session we talk about how to setup Salesforce CLI with VSCode and how to create first Lightning Web Components. Check this post code.

Here is recording of session :-

https://www.youtube.com/watch?v=V_riFQU5iNA&t=1s


24) Invoke Apex Class from Lightning Web Component.

In this session we talk about how to invoke apex class from lightning web component and how to include one LWC into another LWC. Check this post for code.

Here is recording.



Thanks,
Amit Chaudhary
amit.salesforce21@gmail.com






Friday, 21 December 2018

Invoke Apex Controller from Lightning Web Component | Lightning Web Component inside Another LWC


Lightning Web Components are announced as part of Spring19 pre-release. In out last most we talk about how to create first Lightning Web Component. In This post we will talk about how Invoke Apex Controller From Lightning Web Component and how many way we have to call apex class from LWC. 

Call Apex Class / Method:-

Lightning web components can import methods from Apex classes into the JavaScript classes using ES6 import.

import apexMethod from '@salesforce/apex/Namespace.Classname.apexMethod';
  • apexMethod—This identifies the Apex method name.
  • Classname— The Apex class name.
  • Namespace—The namespace of the Salesforce organization
After importing the apex class method you can able call the apex methods as functions into the component by calling either via the wire service or imperatively. We have three way to call Apex method
  1. Wire a property
  2. Wire a function
  3. Call a method imperatively.


Tuesday, 18 December 2018

How to call an Apex class from a Lightning Web component (#LWC) | Invoke Apex Controller from Lightning Web Component | imperatively



Welcome in Lightning Web Components world. Last time we talk about how to create first Lightning Web Component and how to configure VsCode with Salesforce CLI.

We know how to Invoke Apex Class from lightning Component. So Today we will talk about how to invoke apex class from Lightning Web Component.

Finally get some time to play with LWC. Let see how to create LWC to Search a Account Record.

Step 1) Create Apex Class to Search Record.
 
public with sharing class AccountController {
    @AuraEnabled(cacheable=true)
    public static List<Account> findAccounts(String searchKey) {
        String key = '%' + searchKey + '%';
        return [SELECT Id, Name, AccountNumber FROM Account WHERE Name LIKE :key  LIMIT 10];
    }
}
Create on Apex Class with @AuraEnabled annotation and method must be static.

Step 2) Create Lightning Web Component in VsCode. IF you don't know how check here.

SearchAccountRecord.html
<template>
    <lightning-card title="Search Account" icon-name="custom:custom57">
        <div class="slds-m-around_medium">
            <lightning-input type="search" onchange={handleKeyChange} class="slds-m-bottom_small" label="Search"></lightning-input>
            <template if:true={accounts}>
                <template for:each={accounts} for:item="acc">
                    <li key={acc.Id}>
                        {acc.Name}
                        {acc.AccountNumber}
                    </li>
                </template>
            </template>
        </div>
    </lightning-card>
</template>
  • <lightning-input is replacement of lightning:input in .
  • <template if:true is used for checking if condition.
  • <template for:each for Iteration.


SearchAccountRecord.js
import { LightningElement, track } from 'lwc';
import findAccounts from '@salesforce/apex/AccountController.findAccounts';

/** The delay used when debouncing event handlers before invoking Apex. */
const DELAY = 350;

export default class SearchAccountRecord extends LightningElement {
    @track accounts;
    @track error;
    handleKeyChange(event) {
        // Debouncing this method: Do not actually invoke the Apex call as long as this function is
        // being called within a delay of DELAY. This is to avoid a very large number of Apex method calls.
        window.clearTimeout(this.delayTimeout);
        const searchKey = event.target.value;
        // eslint-disable-next-line @lwc/lwc/no-async-operation
        this.delayTimeout = setTimeout(() => {
            findAccounts({ searchKey })
                .then(result => {
                    this.accounts = result;
                    this.error = undefined;
                })
                .catch(error => {
                    this.error = error;
                    this.accounts = undefined;
                });
        }, DELAY);
    }
}
  • "import findAccounts from '@salesforce/apex/AccountController.findAccounts'" is used to get apex class.


SearchAccountRecord.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="SearchAccountRecord">
     <apiVersion>45.0</apiVersion>
    <isExposed>false</isExposed>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
    </targets>
</LightningComponentBundle>
  • <targets> is used to to mention where we can use this LWC component
Output :-




Feel Free to share your feedback. I know we can do lots of improvement in this code. I hope this is not a bad start :)


Related Post :-
1) Create First Lightning Wed Component.
2) Developer Tools for Lightning Web Components.
3) Introducing Lightning Web Components.



Thanks,
Amit Chaudhary
amit.salesforce21@gmail.com