Posts

Showing posts from October, 2020

Salesforce Developer Interview Questions

1. Difference between queueable and batch apex?  Batchable Apex: If it is a long-running complex process then you should go for Batchable Apex and you can have an option to schedule the batch to run at a customized time. It can process up to 50 million records in asynchronous mode. 5 concurrent jobs are allowed to run at a time and future methods are not allowed in the Batch class. Batch Class should implement Database. Batchable interface and it should have three methods start(), execute() and finish() methods. Queueable Apex: It comes in handy when you need to have both the operations of Batch and future method and it should implement Queueable Interface. If one job is dependent on another job means here we can chain the dependent job in execute method by system.enqueuejob(new secondJob()); You can also able to chain up to 50 jobs and in the developer edition, you can able to chain up to 5 jobs only. It will accept non-primitive types like sObjects and it also runs in asynchronous mo

Lightning Web Components Specialist Superbadge Solution Similar Boats Component

 SIMILAR BOATS COMONENT similarBoats.html <template>     <lightning-card title={getTitle} icon-name="custom:custom54">       <lightning-layout multiple-rows="true">         <template if:true={noBoats}>           <p class="slds-align_absolute-center">There are no related boats by {similarBy}!</p>         </template>         <!-- Loop through the list of similar boats -->         <template for:each={relatedBoats} for:item="boat">           <!-- Responsive lightning-layout-item -->           <lightning-layout-item key={boat.Id} padding="around-small" size="12" small-device-size="6"            medium-device-size="4"  large-device-size="4">             <!-- Each boat tile goes here -->             <c-boat-tile boat={boat} onboatselect={openBoatDetailPage}></c-boat-tile>           </lightning-layout-item>         &

Lightning Web Components Specialist Superbadge Solution Five Star Rating Component

FIVE STAR RATING COMPONENT fiveStarRating.html <template>     <ul class={starClass}></ul> </template> fiveStarRating.js //import fivestar static resource, call it fivestar import { LightningElement, api } from 'lwc'; import fivestar from '@salesforce/resourceUrl/fivestar'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import { loadStyle, loadScript } from 'lightning/platformResourceLoader'; // add constants here const ERROR_TITLE = 'Error loading five-star'; const ERROR_VARIANT = 'error'; const EDITABLE_CLASS = 'c-rating'; const READ_ONLY_CLASS = 'readonly c-rating'; export default class FiveStarRating extends LightningElement {   //initialize public readOnly and value properties   @api readOnly;   @api value;   editedValue;   isRendered;   //getter function that returns the correct class depending on if it is readonly   get starClass() {     return this.readOnly ? READ_ONLY_CLA

Lightning Web Components Specialist Superbadge Solution Boat Add Review Form Component

 BOAT ADD REVIEW FORM boatAddReviewForm.html <template>     <!-- lightning data service code -->     <!-- <lightning-record-edit-form> using boatReviewObject -->     <lightning-record-edit-form object-api-name={boatReviewObject} onsuccess={handleSuccess} onsubmit={handleSubmit}>         <lightning-messages></lightning-messages>          <lightning-layout multiple-rows vertical-align="start">         <lightning-layout-item size="8" padding="horizontal-small">           <div class="slds-form-element">                 <!-- review subject field code using nameField -->                 <lightning-input-field field-name={nameField}>                 </lightning-input-field>           </div>         </lightning-layout-item>         <lightning-layout-item size="4" padding="horizontal-small">           <div class="slds-form-element&qu

Lightning Web Components Specialist Superbadge Solution Boat Detail Tabs Component

BOAT DETAIL TABS boatDetailTabs.html <template>     <template if:false={wiredRecord.data}>       <!-- lightning card for the label when wiredRecord has no data goes here  -->         <lightning-card class= "slds-align_absolute-center no-boat-height">             <span>{label.labelPleaseSelectABoat}</span>         </lightning-card>     </template>     <template if:true={wiredRecord.data}>        <!-- lightning card for the content when wiredRecord has data goes here  -->        <lightning-card>            <lightning-tabset variant="scoped">                <lightning-tab label={label.labelDetails}>                    <lightning-card icon-name={detailsTabIconName} title={boatName}>                        <lightning-button slot="actions" title={boatName} label={label.labelFullDetails} onclick={navigateToRecordViewPage}></lightning-button>                        <

Lightning Web Components Specialist Superbadge Solution Boat Map Component

 BOAT MAP COMPONENT boatMap.html <template>   <lightning-card title="Current Boat Location" icon-name="action:map">     <template if:true={showMap}>       <lightning-map map-markers={mapMarkers} zoom-level="10"></lightning-map>     </template>     <template if:false={showMap}>       <span class="slds-align_absolute-center">         Please select a boat to see its location!       </span>     </template>   </lightning-card> </template> boatMap.js import { LightningElement, api, wire } from 'lwc'; import { getRecord } from 'lightning/uiRecordApi'; // import BOATMC from the message channel import { APPLICATION_SCOPE, MessageContext, subscribe, unsubscribe } from 'lightning/messageService'; import BOATMC from '@salesforce/messageChannel/BoatMessageChannel__c'; // Declare the const LONGITUDE_FIELD for the boat's Longitude__s // Declare the const

Lightning Web Components Specialist Superbadge Solution Boat Reviews Component

BOAT REVIEWS COMPONENT boatReviews.html <template>     <!-- div for when there are no reviews available -->     <template if:false={reviewsToShow}>         <div class="slds-align_absolute-center">No reviews available</div>     </template>        <template if:true={reviewsToShow}>          <!-- div for when there are reviews available -->     <div class="slds-feed reviews-style slds-is-relative slds-scrollable_y">     <!-- insert spinner -->     <template if:true={isLoading}>         <lightning-spinner alternative-text="Loading" size="small" variant="brand"></lightning-spinner>        </template>        <ul class="slds-feed__list">         <!-- start iteration -->         <template for:each={boatReviews} for:item="boatReview">           <li class="slds-feed__item" key={boatReview.Id}>             <a

Lightning Web Components Specialist Superbadge Solution Boats Near Me Component

BOATS NEAR ME boatsNearMe.html <template>     <lightning-card class="slds-is-relative">        <!-- The template and lightning-spinner goes here -->        <template if:true={isLoading}>            <lightning-spinner alternative-text="Loading" size="medium" variant="brand"></lightning-spinner>                   </template>        <!-- The lightning-map goes here -->        <template if:true={isRendered}>            <lightning-map map-markers={mapMarkers} zoom-level="10"></lightning-map>                         <div slot="footer">Top 10 Only!</div>         </template>     </lightning-card> </template> boatsNearMe.js import { LightningElement, track, api, wire } from 'lwc'; import getBoatsByLocation from '@salesforce/apex/BoatDataService.getBoatsByLocation'; import { ShowToastEvent } from 'lightning/platformShowToa

Lightning Web Components Specialist Superbadge Solution Boat Tile Component

 BOAT TILE COMPONENT boatTile.html <template>     <div onclick={selectBoat} class={tileClass}>       <div style= {backgroundStyle} class="tile"></div>       <div class="lower-third">           <h1 class="slds-truncate slds-text-heading_medium">{boat.Name}</h1>           <h2 class="slds-truncate slds-text-heading_small">{boat.Contact__r.Name}</h2>           <div class="slds-text-body_small">               Price: <lightning-formatted-number maximum-fraction-digits="2" format-style="currency" currency-code="USD" value={boat.Price__c}>                            </lightning-formatted-number>           </div>            <div class="slds-text-body_small">Length: {boat.Length__c}                         </div>           <div class="slds-text-body_small">Type: {boat.BoatType__r.Name}                  

Lightning Web Components Specialist Superbadge Solution Boat Search Results Component

  BOAT SEARCH RESULTS boatSearchResults.html <template>     <lightning-tabset variant="scoped">       <lightning-tab label="Gallery">         <template if:true={boats.data}>           <div class="slds-scrollable_y">           <!-- layout horizontally aligned to the center  -->           <!-- layout allowing multiple rows -->             <lightning-layout horizontal-align="center" multiple-rows>               <!-- template looping through each boat -->               <template for:each={boats.data} for:item="boat">                 <!-- lightning-layout-item for each boat -->                 <lightning-layout-item key={boat.Id} padding="around-small" size="12" small-device-size="6" medium-device-size="4" large-device-size="3">                   <!-- Each BoatTile goes here -->                   <c-boat-tile boa

Lightning Web Components Specialist Superbadge Solution Boat Search Form Component

  BOAT SEARCH FORM boatSearchForm.html <template>     <lightning-layout>       <lightning-layout-item class="slds-align-middle">         <lightning-combobox onchange={handleSearchOptionChange} value={selectedBoatTypeId}          options={searchOptions} class="slds-align-middle">       </lightning-combobox>       </lightning-layout-item>     </lightning-layout>   </template> boatSearchForm.js import { LightningElement, wire, track } from 'lwc'; import getBoatTypes from "@salesforce/apex/BoatDataService.getBoatTypes"; export default class BoatSearchForm extends LightningElement {  @track selectedBoatTypeId = '';     // Private  @track error = undefined;     // Needs explicit track due to nested data  @track searchOptions;      // Wire a custom Apex method   @wire(getBoatTypes)     boatTypes({ error, data }) {     if (data) {       this.searchOptions = data.map(type => {         return {      

Lightning Web Components Specialist Superbadge Solution Boat Search Component

BOAT SEARCH COMPONENT boatSearch.html <template>     <lightning-layout multiple-rows>       <!-- Top -->       <lightning-layout-item size="12">         <lightning-card title="Find a Boat">           <!-- New Boat button goes here -->           <lightning-button variant="brand" label="New Boat" slot="actions" onclick={createNewBoat}>           </lightning-button>           <p class="slds-var-p-horizontal_small slds-align_absolute-center">             <!-- <c-boat-Search-Form></c-boat-Search-Form> -->             <c-boat-search-form  onsearch={searchBoats}></c-boat-search-form>                     <!-- boatSearchForm component goes here -->           </p>         </lightning-card>       </lightning-layout-item>       <!-- Bottom -->       <lightning-layout-item size="12" class="slds-p-top_small sld

Popular posts from this blog

Lightning Web Components Specialist Superbadge Solution Boat Tile Component

Lightning Web Components Specialist Superbadge Solution Boat Search Results Component

Lightning Web Components Specialist Superbadge Solution Boat Search Form Component