salesforce

image post

How to delay an execution in Salesforce Apex

Using Schedulable interface to delay an execution in Apex
Andrés Canavesi - Jun 10, 2022
In Java, we can use Thread.sleep(1000) to delay the execution by one second. In Apex is not that easy since Salesforce is a multi-tenant environment.

image post

MIXED_DML_OPERATION error and Apex unit tests (how to fix it)

This is a common error when we start to work with testing or manipulating some particular objects: setup and non-setup objects
Andrés Canavesi - Feb 09, 2022
One option is to use @future method but since that's for running in background, we cannot query that data in the next line due to it could be created or not.

image post

AWS suspended error AppFlow

The flow has been suspended due to an error in Salesforce when subscribing to the event.
Andrés Canavesi - Feb 09, 2022
AWS AppFlow suspended status error is sown for many reasons. You have to click on the <i>Suspended</i> word in the AWS console to see the extended error. Another option is to see it through the CLI

image post

AWS AppFlow error conflict executing request connector profile is associated with one or more flows

If we try to delete a connector from the AWS console and it is associated with one or many flows, it will display this error.
Andrés Canavesi - Feb 09, 2022
Let's say you have a Salesforce connector (it is valid for any other available) and the token expired. The only way so far is to delete and recreate the connection again. Would be nice to keep the same connection and run the handshake again but it is impossible nowadays.

image post

Salesforce inspector: a Salesforce data explorer and exporter

Chrome and Firefox extension to inspect and export data from Salesforce
Andrés Canavesi - Jan 18, 2022
A productivity tool for Salesforce administrators and developers to inspect data and metadata directly from the browser without compromising security and privacy

image post

Lightning data table conditional cell color

Set text or background color for lightning data table rows
Andrés Canavesi - Jan 13, 2022
Let say you want to highlight a cell in a Lightning data table (lightning:datatable) when a specific value is invalid. In our example, we want to display those invalid emails in red.


image post

Invalid request provided: AWS::AppFlow::FlowCreate - Salesforce integration

This is a common error when a field is mapped in App Flow but it doesn't exist in Salesforce
Andrés Canavesi - Nov 19, 2021
Resource handler returned message: "Invalid request provided: AWS::AppFlow::FlowCreate Flow

image post

Call an Apex method from Process Builder

See how to configure a Flow with process builder to execute an Apex method in Salesforce
Andrés Canavesi - Nov 11, 2021
As a thumb of rule in Salesforce you should always try to create new business logic through point-and-click but sometimes our logic it's a bit special and we need some Apex code.

image post

Get Record Type id by name in Apex - Salesforce

SOQL query to get a record type by name to use it in Apex code
Andrés Canavesi - Nov 10, 2021
Based on this query we are going to build a method that gets the record type id by its name

image post

AppFlow Salesforce: how to sync up relationships

An elegant solution to sync up relationships from Salesforce to AppFlow
Andrés Canavesi - Nov 10, 2021
Only basic types such as strings or numbers can be passed through AppFlow which means that look-up fields will be ignored. There's a way you can do it with some work from using the Salesforce out-of-the-box Process Builder tool, a custom object and some lines of Apex code.

image post

Load dynamic data into a table using Lightning Web Component

Create a custom tab to display a Lightning Web Component
Andrés Canavesi - Nov 04, 2021

image post

How to generate a random string in Apex

A Apex method to get a random string given a length
Andrés Canavesi - Oct 13, 2021

image post

This is most likely not an error with the salesforce cli

Please ensure all information is accurate and try again. (Salesforce)
Andrés Canavesi - Oct 07, 2021
Error authenticating with auth code due to: grant type not supported

image post

Salesforce rest api download ContentVersion

Download a Salesforce file (ContentVersion) through the API using Node.js with jsforce package
Andrés Canavesi - Sep 09, 2021

image post

error authenticating with auth code due to: grant type not supported

error authenticating with auth code due to: grant type not supported
Andrés Canavesi - Aug 31, 2021
error authenticating with auth code due to: grant type not supported

image post

Salesforce integration with AWS AppFlow, S3, Lambda and SQS

Send data out of Salesforce with AWS AppFlow service in realtime
Andrés Canavesi - Aug 24, 2021
There are many ways to sync up our Salesforce data with third parties. One option is a mix of Salesforce and AWS services, specifically Change Data Capture from Salesforce and AppFlow from AWS.


image post

Magic Mover for Notes And Attachments to Lightning Experience

Get ready for Lightning Experience by migrating your attachments and notes
Andrés Canavesi - May 22, 2021
Files are more versatile and provide better functionality than attachments. Attachments can only be attached to a single record, while files...

image post

How to create files in Salesforce for testing purposes

ContentVersion and ContentDocumentLink creation from Apex
Andrés Canavesi - May 21, 2021
Fortunately, dealing with files in Salesforce in a unit text context, is pretty easy.