@wire with dynamic parameters Call to a...
Salesforce by Annappa Ph
by
3y ago
 @wire with dynamic parameters Call to apex method using @wire is executed at the time component loads. But suppose we want to make server call when a particular parameter changes. So for that we can @wire an apex method with a dynamic parameter. We need to pass a parameter with “$” appended to it while making call to apex method. So, once the value of this property changes, call to apex is made at that time. Apex class public with sharing class ContactController { @AuraEnabled(cacheable=true) public static List<Contact> getContactList ..read more
Visit website
Access Client Form Factor To access the form fact...
Salesforce by Annappa Ph
by
3y ago
Access Client Form Factor To access the form factor of the hardware the browser is running on, import the @salesforce/client/formFactor scoped module. import formFactorPropertyNamefrom '@salesforce/client/formFactor' formFactorPropertyName—A name that refers to the form factor of the hardware running the browser. Possible values are: Large—A desktop client. Medium—A tablet client. Small—A phone client. html <template>     <lightning-card title="formfactorName" icon-name="custom:custom19">        &n ..read more
Visit website
Get Information About the Current User To get info...
Salesforce by Annappa Ph
by
3y ago
Get Information About the Current User To get information about the current user, use the @salesforce/user scoped module. import property from '@salesforce/user/property'; property—The supported properties are Id, which is the user’s ID, and isGuest, which is a boolean value indicating whether the user is a community guest user. Use the isGuest property to check whether or not the user is authenticated. This sample code imports the current user ID and assigns it to the userId property to provide access in the HTML template. html <template> &nb ..read more
Visit website
   Access Static Resources in LWC Import...
Salesforce by Annappa Ph
by
3y ago
   Access Static Resources in LWC Import static resources from the @salesforce/resourceUrl scoped module. Static resources can be archives (such as .zip and .jar files), images, style sheets, JavaScript, and other files. import myResource from '@salesforce/resourceUrl/resourceReference'; import myResource from '@salesforce/resourceUrl/namespace__resourceReference'; myResource—A name that refers to the static resource. resourceReference—The name of the static resource. A static resource name can contain only underscores and alphanumeric characters, and must be unique ..read more
Visit website
Usage of utility classes in Lightning web componen...
Salesforce by Annappa Ph
by
3y ago
Usage of utility classes in Lightning web component: In this demo, explaining about the usage of utility classes in Lwc. I have created utility class inside the  component folder. Utility class name is "Utilityhelper". Utility helper is referred in component of JavaScript Like below : import {add,sub} from './utilityhelper.js'; Complete code Snippet: shareCode.html <template>     <lightning-card title="Usage of Javascript Utility Classes">     <p> add : {resultF ..read more
Visit website
              &...
Salesforce by Annappa Ph
by
3y ago
                                 Calling Child Component Method Using Parent : Example  shows how to call child component method from parent using template.querySelector. findLegend -> Method in childComponent Master Blaster Sachin Tendulkar -> Its parameters passing to findLegend Method In this child component method, findLegend method exposed as api method property. ParentComponent4.html <template>     <lightning-card title="Calling child&nb ..read more
Visit website
              &...
Salesforce by Annappa Ph
by
3y ago
                                         Configuration File Tags apiVersion:- A double value that binds the component to a Salesforce API version. To check the current version, take help of this knowledge article. description:-A short description of the component, usually a single sentence. Appears in list views, like the list of Lightning Components in Setup, and as a tooltip in the Lightning App Builder and in Community Builder. When you hover your mouse to the custom component deployed t ..read more
Visit website
  Component Lifecycle Lightning web compone...
Salesforce by Annappa Ph
by
3y ago
  Component Lifecycle Lightning web components have a lifecycle managed by the framework. The framework creates components, inserts them into the DOM, renders them, and removes them from the DOM. It also monitors components for property changes. Generally, components don’t need to call these lifecycle hooks, but it is possible. Run Code When a Component Is Created The constructor() method fires when a component instance is created. Don’t add attributes to the host element during construction. You can add attributes to the host element in any other lifecycle hook. Run Code When ..read more
Visit website
 Getter property in Lightning web components ...
Salesforce by Annappa Ph
by
3y ago
 Getter property in Lightning web components 1. Use getter property if you want to modify the property before you use in template 2. Use getter property when you don't  want to create a variable html <template>     <lightning-card title="Getter Property"  icon-name="custom:custom14">      <p> Passing variable without declaring variable : {passProperty}</p>      <p> changemessage :  {changemessage}</p> &nb ..read more
Visit website
   Render Multiple Templates You may wan...
Salesforce by Annappa Ph
by
3y ago
   Render Multiple Templates You may want to render a component with more than one look and feel, but not want to mix the HTML in one file. For example, one version of the component is plain, and another version displays an image and extra text. In this case, you can import multiple HTML templates and write business logic that renders them conditionally. This pattern is similar to the code splitting used in some JavaScript frameworks. Note NOTE Although it’s possible for a component to render multiple templates, we recommend using an if:true|false directive to render nested template ..read more
Visit website

Follow Salesforce by Annappa Ph on FeedSpot

Continue with Google
Continue with Apple
OR