This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="SimpleCalculator"> | |
<apiVersion>45.0</apiVersion> | |
<targets> | |
<target>lightning__AppPage</target> | |
<target>lightning__RecordPage</target> | |
<target>lightning__HomePage</target> | |
</targets> | |
</LightningComponentBundle> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LightningElement, track } from 'lwc'; | |
export default class SimpleCalculator extends LightningElement { | |
@track firstNumber; | |
@track secondNumber; | |
@track currentResult; | |
@track operatorUsed; | |
/** | |
* This method will be called when either first number or second number is changed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<lightning-card title="SFDCFacts Calculator" icon-name="standard:formula"> | |
<lightning-layout multiple-rows="true"> | |
<lightning-layout-item size="12" padding="around-small"> | |
<lightning-input type="number" label="First Number" name="firstName" onchange={onNumberChange}></lightning-input> | |
</lightning-layout-item> | |
<lightning-layout-item size="12" padding="around-small"> | |
<lightning-input type="number" label="Second Number" name="secondName" onchange={onNumberChange}></lightning-input> | |
</lightning-layout-item> | |
<lightning-layout-item size="12" padding="around-small"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* JsonToCSVUtility Class | |
* This class has helper functiones to convert json string to csv | |
* @author - Manish Choudhari | |
* */ | |
public class JsonToCSVUtility { | |
public static Integer MAX_ROW = 0; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Controller class for GenericRecordHandler Lightning Component | |
* Contains method to retrieve objects and records | |
* @author - Manish Choudhari | |
* */ | |
public class GenericRecordHandler { | |
// This method retrieves all object list from Salesforce Org | |
// You can filter out object list here, as per you use case | |
@AuraEnabled(cacheable=true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
/** | |
* This function gets object list | |
* @author - Manish Choudhari | |
* */ | |
getObjectList : function(component) { | |
var action = component.get("c.getObjects"); | |
action.setCallback(this,function(response) { | |
var state = response.getState(); | |
if (state === "SUCCESS") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
/** | |
* This function will be called on page load | |
* This sets data table columns and also fetches object list | |
* @author - Manish Choudhari | |
* */ | |
doInit : function(component, event, helper) { | |
component.set('v.columns', [ | |
{label: 'Name', fieldName: 'Name', type: 'text'}, | |
{label: 'Action', type: 'button', initialWidth: 135, typeAttributes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- - **Generic Record Handler Component** | |
- Use this component to edit any record of any object on the same page | |
- The component gives you option to only view custom or standard objects or all objects | |
- You can view your record in read only mode or view mode | |
- @author - Manish Choudhari | |
- --> | |
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" | |
access="global" | |
controller="GenericRecordHandler"> | |
<!-- Init handler, this function will be executed on page load --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* BusinessDays Class | |
* Use this class to operate only on business days | |
* and easily skip weekends and holidays from your logic | |
* @author - Manish Choudhari | |
* */ | |
public class BusinessDays | |
{ | |
public BusinessHours bHours; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
getAllAccounts : function(component, helper) { | |
//Calling BaseJS method to call Aura Method | |
callServer(component, "c.getAccounts", | |
function(response){ | |
if(response){ | |
component.set("v.data", response); | |
//Calling showToast method of BaseJS | |
showToast({ | |
"title": "SUCCESS", |