Posts

Showing posts from June, 2020

Imperative apex call

Imperative apex call:-             If  an  apex class is  not annotated  with cacheable = true  the only option to call it in LWC  is imperative apex call. since  cacheable methods can't perform DML operations. When  dml is needed the only way to call such method in lwc is Imperative apex approach. This method will return the  Promise . Hence we need to handle the Success and Failure response using  then  and  error  function respectively.  While making imperative call to server  the response is served directly in the object and you don't need property.data. Can perform DML too. Can work with objects not supported by User Interface API (Task,Event).      Syntax :-                            javascriptFunctionName(){                          import apexMethodName (parameter)                                      .then( result=> {                                  // whatever results ( records ) we get                                          // do process here                 

Call apex method in lightning web component

 Call  apex method  in lightning web component:-        Lightning web components can import methods from Apex classes into the JavaScript classes. Once 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. The Apex Method should be marked with @AuraEnabled. Before you use an Apex method, make sure that there isn’t an easier way to get the data. See whether a base Lightning component, like lightning-record-form, lightning-record-view-form, or lightning-record-edit-form works for your use case. If they don’t give you enough flexibility, use a wire adapter like getListUi or getRecordUi. And if you can’t use a wire adapter, write an Apex method. Import  syntax :-             import apexMethod  from  '@salesforce/apex/Namespace.Classname.apexMethod';            apexMethod ---  This identifies the Apex Method name .  Classname    ---    apex class name . Namespace ---    namespa
Image
  Wire service :-   1.Wire service is built  on the Lightning Data Service,   2.@Wire is a reactive  service,   3. Components use  @ wire   in their JavaScript class to read data from one of the wire adapters in               the   lightning/ ui* Api   namespace. The wire service provisions an immutable stream of data to the component. Each value in the stream is a newer version of the value that precedes it.  To improve performance Lightning Data Service maintains a client-side cache of record date that   has  been loaded by wire adapter.                       Wire Service       Wire service  syntax:-            import {LightningElement ,wire} from ' lwc ';               import { adapterId } from ' adapterModule ' ;                          @ wire (adapterId, adapterConfig)                                    property or Function ;                                         adapterId (Identifier)  ---   The identifier of the wire adapter. adapterModule (String)  --- The id

Lightning Web Components

                 First we have to  known in how many ways we can interact with Salesforce Data    Salesforce provides several ways for Lightning web components to work with data. Always start  with the simplest solution and move to a solution that allows for more customization as needed.      Different Approach to work with Salesforce Data:-  1.Base Lightning Components built on the Lightning Data Service      -  Use this approach if you want to play with lightning  forms     - To create forms that let user view, edit, and create salesforce records  use the                                              lightning-record-form,                                          lightning-record-edit-form,                             and lightning-record-view-form components 2.Lightning Data Service  Wire Adapters and Functions  with wire service :-    Always use base lightning components  if you want display forms and if  you want perform some customization and logic  then you go for with this appro

Profiles and Roles and Permission sets:-

  The profiles and permission sets are configuration items in Salesforce that will   allow us to control different types of functionalities and the roles with allow us to     control record visibility primarily. Profiles:- A  profile in Salesforce  is a group/collection of settings and permissions that define what a user can do in Salesforce. A profile controls “ Object permissions, Field permissions, User permissions, Tab settings, App settings, Apex class access, Visualforce page access, Page layouts, Record Types, Login hours & Login IP ranges. A profile can be assigned to many users, but a user can be assigned a single profile at a time. profile is mandatory for every user in salesforce , you can't have a user without profile . Types of profiles in Salesforce Standard profiles:  By default, salesforce provides below standard profiles. We cannot delete standard ones. Read Only, Standard User, Marketing User, Contract Manager, Solution Manager & System Administrator.  Eac

interview questions on data loader

Image
        Q. What is upsert in salesforce ? Upsert means to update the record while inserting the record in Salesforce. Upsert = Update + Insert Q.  Can we avoid duplicates using apex data loader which we can do through import wizard? No.        Q. What is difference between “Export” and “Export All” in apex data loader?            Export: It will fetch only active records from salesforce.            Export All: It will fetch active as well as records from recycle bin.                   Q. Can We Bypass The Required Fields In Data Loader?       Ans:  Inserting the records through Data loader Required fields  cannot  be skipped. If you have           Required fields in your object make sure you have values in the CSV for those fields as well. There is no      setting to by bass the required field check. although you can turn off the validation rules simply uncheck the   Active check box.     Q.Hard Delete Not Working In Apex Data Loader? Ans:  Check your Profile permissions  “Bulk API Ha

Data Loader Import Wizard in Salesforce

Data Loader:      Data loader  is a new  External tool provided by Salesforce, It   used to insert and update and Upsert and  delete and  Export data from Salesforce to External System and External System to Salesforce.   It is used to import or export bulk data. When importing  data ,  Data Loader  reads, extracts, and loads  data  from comma-separated values (CSV) files or from a database connection. When exporting  data , it outputs CSV files. Operations performed by data loader:- Insert (Inserting brand new records, no need of ID) Update (Updating the existing records based on the record ID) Upsert (To Upsert we should have one external ID field on the object, based on the external id field if the value already exists it will update, if doesn't exist then it will insert) Delete (Delete the records based on the id provided, to delete we need only id, deleted records can be found in recycle bin) Hard delete (Delete the records based on the id provided, to delete we need only id,