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 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 {

          label: type.Name,

          value: type.Id

        };

          // TODO: complete the logic

      });

      this.searchOptions.unshift({ label: 'All Types', value: '' });

    } else if (error) {

      this.searchOptions = undefined;

      this.error = error;

    }

  }

  

  // Fires event that the search option has changed.

  // passes boatTypeId (value of this.selectedBoatTypeId) in the detail

  handleSearchOptionChange(event) {

    event.preventDefault();

    this.selectedBoatTypeId = event.detail.value;

    // Create the const searchEvent

    // searchEvent must be the new custom event search

    const searchEvent = new CustomEvent("search", {

      detail: {

        boatTypeId: this.selectedBoatTypeId

      }

    });

    this.dispatchEvent(searchEvent);

  }

}


boatSearchForm.js-meta.xml


<?xml version="1.0" encoding="UTF-8"?>

<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">

    <apiVersion>49.0</apiVersion>

    <isExposed>true</isExposed>

        <targets>

        <target>lightning__RecordPage</target>

        <target>lightning__AppPage</target>

    </targets>

</LightningComponentBundle>

Comments

  1. Please mention challenge no because their are 19 task in this superbadge.

    ReplyDelete

Post a Comment

Popular posts from this blog

Lightning Web Components Specialist Superbadge Solution Boat Tile Component

Lightning Web Components Specialist Superbadge Solution Boat Search Results Component