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> | |
<c-grand-child></c-grand-child> | |
</template> |
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={hasError}> | |
<div class="slds-notify slds-notify_alert slds-theme_alert-texture slds-theme_error" role="alert"> | |
<span class="slds-assistive-text">error</span> | |
<h2>Application Error:{error.message} | |
</h2> | |
</div> | |
</template> | |
<c-child-module></c-child-module> | |
</template> |
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 class EinsteinOCRReponse { | |
public list<Probability> probabilities{get;set;} | |
public String objects{get;set;} | |
public String task{get;set;} | |
public class Probability{ | |
public boundingBox boundingBox{get;set;} | |
public String label{get;set;} | |
public Decimal probability{get;set;} | |
} | |
public class BoundingBox{ |
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 class EinsteinOCR { | |
public static String VISION_API = 'https://api.einstein.ai/v2/vision/ocr'; | |
public static string extractText(String imageUrl, String token, String model) { | |
HttpRequest req = new HttpRequest(); | |
req.setMethod('POST'); | |
req.setEndpoint(VISION_API); | |
req.setHeader('content-type', 'multipart/form-data; charset="UTF-8"; boundary="1ff13444ed8140c7a32fc4e6451aa76d"'); | |
req.setHeader('Authorization', 'Bearer '+ token); //replace token with your access token |
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 class EinsteinController { | |
public String getAccessToken() { | |
ContentVersion base64Content = [SELECT Title, VersionData FROM ContentVersion where Title='einstein_platform' OR Title='predictive_services' ORDER BY Title LIMIT 1]; | |
String keyContents = base64Content.VersionData.tostring(); | |
keyContents = keyContents.replace('-----BEGIN RSA PRIVATE KEY-----', ''); | |
keyContents = keyContents.replace('-----END RSA PRIVATE KEY-----', ''); | |
keyContents = keyContents.replace('\n', ''); | |
JWT jwt = new JWT('RS256'); | |
jwt.pkcs8 = keyContents; |
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 class CaseService { | |
public static void UpdatePlateNumber(string record,string plate) | |
{ | |
try | |
{ | |
Case caseRecord=[Select Id, Plate_Number__c from Case where id=:record]; | |
caseRecord.Plate_Number__c=plate; | |
update caseRecord; | |
} |
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 * as fs from 'fs'; | |
import * as fse from 'fs-extra'; | |
import * as path from 'path'; | |
export class Code | |
{ | |
updateContent=function(content, values) { | |
const splitValues = values.split('='); | |
const varName = splitValues[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
public trigger {{objectName}}Trigger on {{entityName}}( after insert, after update, before insert, before update) | |
{ | |
{{objectName}}TriggerHandler handler = new {{objectName}}TriggerHandler(Trigger.isExecuting, Trigger.size); | |
if( Trigger.isInsert ) | |
{ | |
if(Trigger.isBefore) | |
{ | |
handler.OnBeforeInsert(trigger.New); | |
} |
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 with sharing class {{objectName}} { | |
//save record | |
public void save{{objectName}}(string name) { | |
try | |
{ | |
{{objectName}}Selector objRecord=new {{objectName}}Selector(); | |
{{objectName}} record=objRecord.getByName(name); | |
if(record!=null) |
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> | |
<h2>Hkhdshsa</h2> | |
<lightning-card title="Used Custom Metadata" icon-name="custom:custom10"> | |
<div class="slds-grid"> | |
<div class="slds-size--1-of-1"> | |
<div> | |
<lightning-button label="Export in CSV" onclick={handleFileDownload}></lightning-button> | |
</div> | |
</div> | |
</div> |