Showing posts with label Lightning Experience. Show all posts
Showing posts with label Lightning Experience. Show all posts

Wednesday, December 4, 2019

Issue With Lightning-Button Click Action (Outside the button) In LWC

Issue:

If your using <lightning-button> in your component and this button is invoking the action even if you clicked outside of the button(it means the horizontally anywhere on the screen).

Route Cause:

This is because by default if your not setting any width to the button it will considers the entire width as the scope of the button.So,if you click anywhere on the screen horizontally to this,it will invokes the action automatically.

If you look at the below image the blue line has occupied entire width of the screen ,it means the scope of the button is spread like blue line.So,if you click anywhere it's get invoked automatically.



Sample button code:


 <template if:true={showIsCheck} class="slds-is-relative">
     <lightning-button label="Check ?" title="Check" 
          variant="success" onclick={checkIsCan} 
          class="slds-align_absolute-center slds-m-top_medium ">
     </lightning-button>
    
        <div if:true={isLoading}>
            <lightning-spinner alternative-text="Loading..." variant="brand" size="large" class="slds-is-absolute"></lightning-spinner>
        </div>
 </template>

Workaround:

Please set the width of the button so that the scope of the button will automatically bounds within the button.If you look at the below code snippets and image you can clearly undertsraynd that as soon as I sets the width the blue line is becoming small(Scope of the button).


 <template if:true={showIsCheck} class="slds-is-relative">
        <lightning-button label="Check ?" title="Check" 
            variant="success" onclick={checkIsCan} 
          class="slds-align_absolute-center slds-m-top_medium slds-size_medium"></lightning-button>
    
        <div if:true={isLoading}>
            <lightning-spinner alternative-text="Loading..." variant="brand" size="large" class="slds-is-absolute"></lightning-spinner>
        </div>
 </template>


a)when size as small

b)when size as medium


Thanks for visiting..hope this helps you!

Thursday, August 8, 2019

How to Use SLDS Icons/SVGs in Visual Force Pages

To use Icons/Svgs in visual force pages below 2 steps is required

  • Include latest slds styles   <apex:slds />
  • apply use property in svg tag with required icon
       <use xmlns:xlink="http://www.w3.org/1999/xlink" 
           xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#call" />
                

<apex:page standardController="Case" docType="html-5.0" id="pageId" showHeader="false" showChat="false" sidebar="false" lightningStylesheets="true">
    <apex:slds />
    <apex:form id="formId" >
        <div class="slds-truncate sldswordWrap" >
            <span class="slds-icon_container slds-icon-standard-call" title="Dial To Bo">
                <svg class="slds-icon" aria-hidden="true">
                    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/apexpages/slds/latest/assets/icons/standard-sprite/svg/symbols.svg#call" />
                </svg>
                <span class="slds-assistive-text">Description of icon when needed</span>
            </span>
        </div>
    </apex:form>
</apex:page>

Output:



Hope this helped you..Enjoy!..

Wednesday, July 10, 2019

How To Check Whether User is In Console or Not in Lightning Experience

Basically if you want to check whether user in Lightning experience console(sales/service consoles in lightning experience not the just lightning experience ) you can use the same sforce console methods which you have used in classic.This method will support in lightning experience with out any changes.

Sample code:

<apex:page> 
<apex:includeScript value="/support/console/42.0/integration.js" /> 
<apex:includeScript value="/support/api/41.0/interaction.js"/> 

<button onclick="openTab();" > Console openPrimaryTab</button> 

<script> 
function inConsole() { 
if (sforce.console.isInConsole()) { 
alert('In console'); 
}else { 
alert('Not in console'); 
} 
}
</apex:page>

Note:
Even after using this if it's not working please check you version of /support/api/42.0/integration.js. If your version is below 42 then it will not work.So,please change the version it will work automatically.

Hope this helped you..Enjoy!..

Saturday, July 6, 2019

Lightning Web Components (lwc) Are Not Showing in SF While Adding To Layout

Even after pushing the lighting web components into sf ,if it's showing in components list but not showing while adding to any layout ,it means your .js-meta.xml file has some issue.

Please check whether <targets> is specified for this component or not.Targets is nothing but where are in places this component can be accessible/usable like App page ,Record detail page or in home page layout.

Proper js-meta.xml will be like

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="SalesforceSampleLWC">
<apiVersion>46.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
</targets>
</LightningComponentBundle>

Hope this helps you...Enjoy!

Base Lightning Components in Salesforce LWC

In Lightning web components(lwc) we will Base Lightning Components to display the particular record information/to create a record quickly with provided information with out using any custom apex.

List of the available Base Lightning Components are
  • lightning-record-edit-form
  • lightning-record-form
  • lightning-record-view-form

lightning-record-edit-form:

  • This component wrapper accepts the record id to display one or more fields and labels related to that field corresponding to given record id 
  • This will not require any apex because it uses Lightning Data Services to fetch the data
  • This will not support Standard objects like Task and Events.
  • Use lightning-output-field to display data in read only format
  • Use lightning-input-field to edit these fields in edit on record edit page

lightning-record-form:

  • Use this component to build the forms quickly to create a record,view the record or to update the record. 
  • Building the record creation forms is easier than building the form using lightning-record-edit-form and lightning-record-view-form. 
  • This component accepts 4 properties like object name which is mandatory,record id which is optional in case of create record ,mode to specify view/edit/read only and layout type like Full or compact
  • It will also takes care of FLS and sharing rules
 <lightning-record-form  
   record-id="739hchjsh773"  
   object-api-name="Position__c"  
   layout-type="Full"  
   mode="view">  
 </lightning-record-form>  

lightning-record-view-form:

  • Use this component when you want to dispaly the record on view mode
  • This will not require any apex because it uses Lightning Data Services to fetch the data
  • This will not support Standard objects like Task and Events.
  • It will also takes care of FLS and sharing rules.

For more information refer:

Hope this helps you...Enjoy!

How To Access Salesforce Org Data in Lightning Web Components

In Classic if you want access/create the Salesforce Data we can either use some Standard Controllers or Custom controllers .Similar to Classic in Lighting Web Components also you can use two different ways to access/create the data into Salesforce objects or to show the Salesforce objects data in Lightning Web Components.

  1. Base Lightning Components
  2. Wire Services

Base Lightning Components:


These are the standard salesforce components which will be used to view the record,to edit the record and to view the record in read only mode.

Benefits:
  • Doesn't require apex code
  • Field labels are displayed based on org default
  • It's has built over Lighting UI API and Lightning Data Service API
  • It access models Static and Dynamically
  • Metadata Aware
  • Custom rendering of data
  • Custom layouts and multi column layouts



Wire Service:

Wire service will use Lighting /UI API Module and Lightning Data Service to fetch the data from the Salesforce Servers/Objects and to show it in the components.Basically we have to import the wire adapters into our lighting web components js file in order to build the communication between the components and servers.The results returned from the wire adapter will be stored either in property or function.

  • Lighting /UI API Module : It will contains bunch of wire adapters(small segment of code) and some JS APIs. These wire adapters will be used to fetch the data from the servers and these JS APIs if you want to modify this data or to push the data into servers.

  • Lightning Data Service : It will act an interface between the wire adapters and data base to get the data from the data base into the adapters. Basically adapters will interacts with Lightning Data Services to fetch the data from the data base.









 Hope this helps you...Enjoy!


Friday, July 15, 2016

Salesforce Interview Questions -Compact Layouts

1. What is Compact Layout?

    The devices like in Mobile (Salesforce1) we will be running out with space constrains . So with the help of Compact Layouts we can  highlight the record key fields at glance .These layouts will help you to arrange necessary fields at record's highlight area.

2. If you haven't created compact layout what will happens in Salesforce1?

    It's not required to create a compact layout in salesforce .If you haven't created system will uses a predefined system generated read only compact layout

3. What fields will be included in default compact layouts?

    It will includes only Name field as part of compact layout

4. How many fields will be shown as part of record highlights section ?

   In Salesforce1 first 4 fields will be included
   In Lightning Experience first 5 fields will be included

5. How many fields you can add to Compact Layouts?

   10 fields

6. What are unsupported field types in compact layouts?
  • Text areas
  • Long text areas
  • Text areas
  • Multi-select pick lists
7. Can we assign different compact layouts to different users?
   
    No,only one compact layout will be assigned to all users

Thanks for visiting..hope this helps you!

Compact Layouts Salesforce Interview Questions

1. What is Compact Layout?

    The devices like in Mobile (Salesforce1) we will be running out with space constrains . So with the help of Compact Layouts we can  highlight the record key fields at glance .These layouts will help you to arrange necessary fields at record's highlight area.

2. If you haven't created compact layout what will happens in Salesforce1?

    It's not required to create a compact layout in salesforce .If you haven't created system will uses a predefined system generated read only compact layout

3. What fields will be included in default compact layouts?

    It will includes only Name field as part of compact layout

4. How many fields will be shown as part of record highlights section ?

   In Salesforce1 first 4 fields will be included
   In Lightning Experience first 5 fields will be included

5. How many fields you can add to Compact Layouts?

   10 fields

6. What are unsupported field types in compact layouts?
  • Text areas
  • Long text areas
  • Text areas
  • Multi-select pick lists
7. Can we assign different compact layouts to different users?
   
    No,only one compact layout will be assigned to all users

Thanks for visiting...Enjoy!


Business Scenarios That Are Not Supported in Lightning Experience

Salesforce Lightning Experience:

Each object in world will have it's own Pros and Cons .Based on the situations we have to pick the things which suits best for your functionality .Similarly Lightning Experience has it's own advantages as well as disadvantages compared to Salesforce Classic.At this point of time it's better saying not supported instead of framing it as a disadvantages because Salesforce Team is working very hard to bring all the features that supports in Salesforce Classic to Salesforce Lightning .It will take some time.

In this post I'm gone explain you some of the business scenarios that will support in Salesforce Classic and but not in Salesforce Lightning.
  • If your current business is related to Quotation generation with help of Standard Quotes in Salesforce that will not be supported in Salesforce Lightning .
  • If your Sales process team using any kind of forecasting mechanism to manage your company pipeline that will not supported in Salesforce Lightning.
  • If your sales team using Sales console to manage the multiple leads at a time that feature is also not available in Salesforce Lightning.
Above listed business scenarios are few examples .Please follow the same blog to find many other Pros and Cons related to Salesforce Lightning in upcoming posts.

Thanks for visiting...Enjoy!




Thursday, July 14, 2016

How To Access Global Quick Actions in Salesforce Lightning Experience

Follow below steps to Access Global Quick Action in Lightning Experience

1. Goto Setup in LE and locate + plus symbol next to App Launcher



2. Click on Plus symbol to access available Global Quick Actions



3. Click on New Task to create a task from home page then in right hand side at bottom a form will be open to create a Task .Fill it and click save to create a quick Task



Thanks for visiting...Enjoy!

How To Enable a Lightning Experience In Salesforce Orgs

Please follow the below steps to enable a lightning experience in Salesforce

1. Go to Setup---->In Left side navigation click on Lightning Experience link

 2. Go to Enable the New Salesforce Experience 

3. Draw as shown in image to enable the lightning experience


 4. Click on Finish Enabling Lightning Experience button to finsih it up.

5. Go to Setup--->Click on Switch to Lightning Experience link to open Lightning Experience



Thanks for visiting...Enjoy!

Salesforce1 Technical Support Is Not Available From Winter 17 on Selected IOS and Android Devices

As per the Salesforce Product notifications following Winter 17 Salesforce will not provide any kind of technical support or bugs raised on below listed devices running on Salesforce1 downloadable app or supported mobile browsers on which Salesforce1 can run.

List of the Devices 

  • iPhone 5
  • iPhone 5C
  • iPad Mini 2
  • iPad Mini 3
  • iPad 4
  • All Android phones except for Samsung Galaxy S5, S6 and S7; Samsung Galaxy Note 4 and Google Nexus 5X and Google Nexus 6P
  • All Android tablets except for Samsung Galaxy Note 10.1 and the Samsung Tab A 9.7

As per Salesforce notification it's planned from October 2016 it may or may not be changed based on Salesforce Release update.

For more information please visit below links

Thanks for visiting..Enjoy!

Wednesday, July 13, 2016

How to Change the Default Navigation Menu Items in Salesforce Lightning Experience.

We already started exploring on lightning experience ,which is an latest UI which will helps the Sales reps to access necessary data at glance to close more deals with lightning speed.In this post I will explain how to change the default navigation menu options in lightning experience.

Navigation Menu:

Below Screen shows what is meant by Navigation Menu in lightning experience .It usually contains all objects tabs.To change the tabs or to reorder the tabs in side navigation please follow further steps



1. Goto Setup--->Apps--->Navigation Menu--->Click on New button as shown below.


2.Enter Label Name and Description for Navigation Menu and click on Next button

3.Please Select/Deselect the Required Tabs from Available Items/Navigation Menu Items respectively


4.Please Select the list of Profiles to whom you want to apply these Navigation Menu



5.Click on Save and Finish Button and Reload the complete page and see the changes in Menu



Thanks for visiting...Enjoy!