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"> | |
<apiVersion>50.0</apiVersion> | |
<isExposed>true</isExposed> | |
<targets> | |
<target>lightning__AppPage</target> | |
<target>lightning__RecordPage</target> | |
<target>lightning__HomePage</target> | |
<target>lightning__Tab</target> | |
</targets> |
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'; | |
import getAddressByCoordinatesApex from '@salesforce/apex/BingMapProvider.getAddressByCoordinates'; | |
import getCoordinatesByAddressApex from '@salesforce/apex/BingMapProvider.getCoordinatesByAddressJson'; | |
import getDrivingDistanceApex from '@salesforce/apex/BingMapProvider.getDrivingDistanceJson'; | |
export default class BingMapTest extends LightningElement { | |
@track isLoading = false; | |
// address by coordinates |
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> | |
<template if:true={isLoading}> | |
<lightning-spinner variant="brand" size="large" alternative-text="Please wait..."></lightning-spinner> | |
</template> | |
<div class="slds-card"> | |
<lightning-layout> | |
<lightning-layout-item padding="around-small"> | |
<lightning-input type="text" label="Latitude" value={latitude} onchange={handleLatitudeChange}></lightning-input> | |
</lightning-layout-item> |
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
public without sharing virtual class BingMapProvider { | |
private static String apiEndpoint = 'https://dev.virtualearth.net/REST/v1/'; | |
private static String apiKey = 'YOUR_API_KEY_HERE'; | |
/** | |
* @description | |
* Given decimal Lat/Lon coordinates - try to get address details | |
* makes a call like this: | |
* http://dev.virtualearth.net/REST/v1/Locations/47.64054,-122.12934?o=json&key={{BingMapsAPIKey}} | |
* |
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
document.addEventListener("fsl-ready", function(e) { | |
if (e.detail) { | |
document.getElementById("load").load = 'Inside e.Detail'; | |
} else { | |
document.getElementById("load").innerHTML = 'Inside else-load'; | |
} | |
}); | |
function getPickListValues(objectType, fieldName) { |
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
<html> | |
<head> | |
<title>FSL Extension Toolkit</title> | |
<script src="scripts/fsl.js"></script> | |
</head> | |
<body> <pre id="load"></pre> <pre id="picklist"></pre> <pre id="showRecord"></pre> <pre id="query"></pre> <pre id="recordids"></pre> | |
<button onclick="showRecord('0WO3K0000004S7tWAE','WorkOrder');">Get Record</button> | |
<button onclick="query('Status','Ready for Assignment','WorkOrder','Select Id FROM WorkOrder');">Execute SOQL</button> |
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 } from 'lwc'; | |
import {subscribe,unsubscribe,createMessageContext,releaseMessageContext,APPLICATION_SCOPE} from 'lightning/messageService'; | |
import sampleMC from "@salesforce/messageChannel/VFLWC__c"; | |
import { ShowToastEvent } from 'lightning/platformShowToastEvent'; | |
export default class HM_ComponentRefresher extends LightningElement { | |
subscription = null; | |
contextvar = createMessageContext(); | |
connectedCallback(){ | |
this.subscribeMsg(); | |
} |
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
<apex:page lightningStylesheets="true" showHeader="false" sidebar="false"> | |
<div class="btn-group"> | |
<button onclick="sendToLWC('Success!',true);">Success!</button> | |
<button onclick="sendToLWC('Error!',false);">Error!</button> | |
</div> | |
<script type="text/javascript"> | |
var MsgChannel = "{!$MessageChannel.VFLWC__c}"; //Message Channel which we created. Acts like a delivery service |
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"?> | |
<LightningMessageChannel xmlns="http://soap.sforce.com/2006/04/metadata"> | |
<description>This Lightning Message Channel is Used for calling LWC Events</description> | |
<isExposed>true</isExposed> | |
<lightningMessageFields> | |
<description>Boolean Check</description> | |
<fieldName>BoolVal</fieldName> | |
</lightningMessageFields> | |
<lightningMessageFields> | |
<description>Message</description> |