Thursday 21 September 2017

Salesforce Trailhead : Lightning Experience Rollout Specialist

Salesforce Trailhead : Lightning Experience Rollout Specialist

Before I start sharing information about superbadge. I am sharing a link of an unmanaged package. After installing this unmanaged package in your org you will be able to clear App builder and Suggestion Box badges which are pre requisite to unlock this superbadge.

Note: Before installing this package enable lightning, domain and account teams in your org.

https://login.salesforce.com/packaging/installPackage.apexp?p0=04t28000000bALD

Challenge 1:

Login your org go in Setup--> Account--> Button Links and Actions-->Click on account tab
Override with Visualforce page Account Tab

Go in Setup--> Home Page Layouts --> DE Default--> Edit--> Add Destination Success Registration component.

Create Two users with below screen shot information.

Create two Permission sets
LightningExperiencePilotSales 
LightningExperiencePilotCommunications

Lightning Experience Pilot Sales will have only lightning user permission as per screen shot.

Lightning Experience Pilot Communications will have lightning user permission as well as not allow to switch between lightning and classic. As per screen shot.


Setup-->Lightning Experience Migration Assistant-->Get Started-->Next-->Tab Check Readiness-->Click Button check Readiness. This will send a report to you.

Setup-->Monitor-->Optimizer--> Launch . This will send you a report.

Challenge 2:

It is a quiz and below are screen shots of it.









Challenge 3:

For your Visulaforce page of account override code with this one.

<apex:page standardStylesheets="false" standardController="Account" recordSetVar="accounts" tabStyle="account">
<apex:slds />

    <div class="slds-scope">
        <apex:pageBlock >
 
            <apex:pageBlockTable value="{!accounts}" var="a"  styleClass="slds-table" >
                <apex:column headerValue="{!$ObjectType.Account.Fields.Name.Label}">
                    <apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink>
                </apex:column>
             
            </apex:pageBlockTable>
        </apex:pageBlock>
    </div>

</apex:page>


For documents, download Destination Success image from documents and upload it in Files and make it available for users.

Challenge 4:
Create 2 account record types and 2 compact layouts and assign them to appropriate profiles.

Setup--> Path Setting--> Create New Path with below given values. Make sure that you add guidance for success values too and activate path.

**Stage****Fields****Guidance for Success**
QualificationAccount Name, Opportunity Name, Description- Ask the buyer about their favorite footwear.
- Share the most appropriate sections of our catalog.
- Share testimonials from fashionistas.
- Present our most popular ranges to the buyer.
Needs AnalysisExpected Revenue, Main Competitor(s), Next Step, Probability(%)- Ask about the maximum price that the buyer is willing to spend.
- Ask: "Is there anything else you'd like to know or need to proceed with the purchase?"
- Set a date for follow-up.
Negotiation/ReviewAmount, Quantity, Stage- If the buyer seems likely to walk away from the deal, discount 5%.
- Follow up on questions or needs from the buyer.
Closed LostClose Date, Next Step- Create post-mortem notes.
- Set a follow-up date for 1 year from today.
Closed WonClose Date, Delivery/Installation Status- Celebrate in Chatter!
- Check with the Accounts team for payment processing.

Challenge 5:
It is a quiz and below are screen shots of it.









Challenge 6:


  1. Create the App page with name : Key Sales Data
  2. select any template 
  3. add Filter List component from left side component list.
    1. In the Filter List Component select Account and for filter value select 'New This Week'
  4. Add Recent Items component, in object select : opportunity,Lead,Contacts.
  5. In Actions select Log call and New Opportunity component.

Create a lightning App named it Communication. Use Account, Chatter, reports and Dashboards tab only and assign to custom sales profile.

Create a lightning page as record page on group object and use following items on it.
Page name will be Group Record Page.
Highlights Panel
Record Detail
Recommendations
Trending Topic
Activate this page and assign it as Org Default.
Create a chatter group with name All Lusso Scarpe Employees and Description as This group is for all Lusso Scarpe employees to collaborate and receive company announcements. All employees can join the group. Make it a public group.

Challenge 7:

Create a report name Opportunities Pipeline.  Use opportunity and then group by report with stage--> Type--> Probability and sum account field.
No filters all opportunities with all time.
Add funnel chart with stage and record count.
Schedule report-John Wiseman wants to review the Opportunities Pipeline report each week. Set it up so he receives refreshed report results by email every Monday at 8:00am.


Add this chart in lightning page on account object you created in app builder badge. Name this chart as Opps by Stage.
Create a Dashboard name Sales Operations and a dashboard folder name Sales Operations. Make dashboard as logged in user save it sales operation folder and add filter on opportunity stage.
  • Horizontal bar chart called Opp Probability by Stage, showing probability by stage
  • Gauge called Sum of Opportunity Amount, showing the sum of revenue generated by all opportunities
  • Donut called New and Existing Business, showing the sum of revenue generated by new and existing business.

Challenge 8:

Enable knowledge lightning. Before searching for knowledge make sure that you are a Knowledge user. Go on your user record and check the knowledge user checkbox.
Note: Make sure that you enable lightning knowledge.
Now go Setup--> Knowledge Object Setup-->New fields and relationship.
Create a field Question Text(255)
Create a field Answer Rich Text Area(32768)
Now go on Record type--> New.
Create 3 record types Community, FAQ, Product.
Now go on Pagelayouts --> New.
Create 3 pagelayouts faqpagelayout, productpagelayout, and communitypagelayout and assign it to respective layouts.
Add question answer and record type field on above 3 layouts.
Go in Salesforce lightning. Click setup and then go app manager. click on new lightning app.
Create a lightning App and named it Lightning Knowledge.
In utility bar add history component.
Selected tabs will case accounts and contacts.
Go in lightning app builder--> New.
Create a new home page name Org Home.
Add Chatter feed, Today's Tasks, upcoming events, recent items, smart scope recent records.
Activate page and assign it as default for Org.
Note: in recent items component make sure that you have account contact and cases are added as tabs.

Challenge 9:

It is a quiz and below are screen shots of it.


Challenge 10:

Create a lightning component "DestinationSuccess".
In component put this code.

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >

 <aura:attribute name="myURL" type="String" default="https://www.salesforce.com/campaign/destination-success/overview/"/>

    

    <ui:outputURL value="{!v.myURL}" label="DestinationSuccess" target="_blank"/>
    
</aura:component>
in controller write this code.
({
    navigate : function(component, event, helper) {
         var address = component.find("address").get("v.myURL");
        var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
      "url": 'https://www.salesforce.com/campaign/destination-success/overview/' + address
    });
    urlEvent.fire();
    }
})
Switch org to lightning if you are not alredy in it. 
Go in setup--> App Manager--> App--> Sales lightning app---> Edit.
Add newly created destination success component in utility bar.
Go on Object manager --> Case --> Button links and Action--> New Action.
Create an action with name UpsellCrosssellOpportunity. Use lightning component create opportunity.
Add this link on case layout.

Create a report with name Campaign Influence Lightning.
Use already built in Campaign Influence report type.
Make it a summary report. Show all campaign. Add filter campaign name equals blank and campaign id equals blank.
Sum Opportunity amount and group by campaign name.
Add following columns as shown in screen shot.

Copy this report id and keep it we will use it later.
Go in Setup --> Object Manager --> Campaign ---> Button links and Action--> New Button or link.
Create a detail page link and name it View Lightning Campaign Influence Report.
Add below Url
/one/one.app#/sObject/00O7F000003ynrX/view?&fv0={!Campaign.Name}&fv1={!Campaign.Id}
replace 00O7F000003ynrX idwith your report id.
Add this link on page.

Now you are done. You successfully competed Superbagde :)

Friday 15 September 2017

Lightning - Change quote status to approve

Lightning - Change Quote Status to Approve

Few days back i got chance to work on lightning. Al thought it is very small request but wanted to share my code here.

Business Requirement

On Quote object( Custom Object due to some business requirements) clients needs a button called "Approve". so once this button is clicked quote status should be changed to approve. Doing this in classic is a piece of cake but lightning is a bit new for me, so i have to put some time to get familiar with Aura framework.

Solution

Created a lightning component and use it on the object specific action to show a button in lightning.

Handler Code

({ doInit : function(component, event, helper) {
    var qid = component.get("v.recordId");
        var action = component.get("c.saveQuote");
        action.setParams({"QID": qid});

        action.setCallback(this, function(response) {
            var state = response.getState();
            if(component.isValid() && state == "SUCCESS"){
                var c = response.getReturnValue();
                component.set("v.quote", c);
                $A.get("e.force:closeQuickAction").fire();
                $A.get('e.force:refreshView').fire();
            }

            else {
                console.log('There was a problem : '+response.getError());
            }
        });
        $A.enqueueAction(action);


} 
})

Class Code

public class ApproveQuoteController 
{
public static FConnect__Service_Quote__c saveQuote(Id QID){
    FConnect__Service_Quote__c Cquote= [select id,name,FConnect__Account__c,FConnect__Status__c,FConnect__Contact__c,FConnect__Site__c,FConnect__Problem__c
                   from FConnect__Service_Quote__c where id=:QID limit 1];
                       
        Cquote.FConnect__Status__c = 'Approved';

        update Cquote;
        return Cquote;
    }
}

Component Code

<aura:component controller="ApproveQuoteController" implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId,force:lightningQuickAction" access="GLOBAL" >
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />

</aura:component>