This file contains 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
# A terminal should be connected to the org using SFDX CLI! | |
# dev - the name of the org | |
# Omni_Channel_Presence_Statuses - the name of the permission set | |
# "Available for Cases,Away,Missed Cases" - the list of statuses to enable | |
node index.js dev Omni_Channel_Presence_Statuses "Available for Cases,Away,Missed Cases" |
This file contains 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
#!/bin/bash | |
# Initial server setup and dependencies installation | |
apt-get update | |
apt install curl git gpw ufw -y | |
# Install RUST and dependencies | |
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y | |
source /root/.cargo/env | |
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - |
This file contains 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
Log__c log = (Log__c) new FabricatedSObject() | |
.set(Constants.Log.SEVERITY, 'ERROR') | |
.add(Constants.Log.TRANSACTION_STATUS, 'ERROR') | |
.toSObject(); | |
FieldsRelationship__mdt fieldRel = (FieldsRelationship__mdt) new FabricatedSObject(); | |
.set(Constants.FieldsRelationship.IS_EXTERNAL_ID, true) | |
.add(Constants.FieldsRelationship.OBJECTS_RELATIONSHIPS, new List<?>()) | |
.toSObject(); | |
This file contains 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 inherited sharing class Constants { | |
public static Log Log { | |
get { | |
return Log == null ? (Log = new Log()) : Log; | |
} | |
private set; | |
} | |
public static CustomMetadataType CustomMetadataType { | |
get { |
This file contains 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
/** | |
* @description Contains a simple logic to create a stub instance using given <code>Type</code> and actual | |
* <code>StubProvider</code> concrete instance. | |
* The main mission of the class to provide a workaround for Apex Stub API Limitations: | |
* - The object being mocked must be in the same namespace as the call to the Test.createStub() method | |
*/ | |
@IsTest | |
global class StubProviderFactory { | |
global Object createStub(Type type, StubProvider provider) { |
This file contains 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
component.lax.enqueue('c.save') | |
.then(result => { | |
// handle "SUCCESS" save result | |
}) | |
.error(e => { | |
// handle "ERROR" save result | |
// e.name === "ApexActionError" | |
}) | |
.incomplete(e => { | |
// handle "INCOMPLETE" save result |
This file contains 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
// registration in the root: | |
component.lax.util.registerError(MyCustomError) | |
// usage in the child components: | |
const errors = component.lax.errors; | |
component.lax.enqueue('c.save') | |
.then(result => { | |
throw new errors.MyCustomError(); | |
}) | |
.catch(errors.MyCustomError, e => { |
This file contains 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
// define custom error | |
function MyCustomError() {} | |
MyCustomError.prototype = Object.create(Error.prototype); | |
MyCustomError.prototype.constructor = MyCustomError; | |
// throw new custom error and handle with .catch | |
component.lax.enqueue('c.save') | |
.then(result => { | |
throw new MyCustomError(); | |
}) |
This file contains 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
function MyCustomError() {} | |
MyCustomError.prototype = Object.create(Error.prototype); | |
MyCustomError.prototype.constructor = MyCustomError; |
This file contains 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
const errors = component.lax.errors; | |
component.lax.enqueue('c.save') | |
.then(result => { | |
// handle "SUCCESS" save result | |
}) | |
.catch(errors.ApexActionError, e => { | |
// handle "ERROR" save result | |
}) | |
.catch(errors.IncompleteActionError, e => { | |
// handle "INCOMPLETE" save result |
NewerOlder