1. Home
  2. Docs
  3. Guides
  4. Automation
Live Chat

Automation Guide

There are a number of ways you can use automation with our app and its a simple case of clicks and not code.

Introduction

There are a number of ways you can use automation with our app and its a simple case of clicks and not code. These include the Creation of Shipments, Emailing Labels, Calculating Rates and Tracking Shipments all utilizing process builder..

If you are happier to use Flows then you can follow this guide here.

Creating Shipments

Our invocable method allows you to create a shipment from any object that you have set up a Custom Address Source for using Process Builder. If you haven't set up a Custom Address Source then please follow this guide that explains how to do so.

In this example we will create a shipment from the Opportunity object when the Stage field gets set to "Closed Won".

Step 1. Set all required fields

In your Custom Address Source you will need to have these items set as a minimum:

Recipient Address Fields:

  • Name Field
  • Street 1 Text Line Field
  • City Field
  • State Field
  • Postal Code Field
  • Country Field
  • Phone Field

Packages

Preferences

Preference Field: the value of this field can be set to the name of the preference (e.g. "ShipmatePreference-0000")

Shipment / Package Type

Service Types

Reference Field

Shipment Auto-create

Step 2. Setup Process Builder Task

Create a Process Builder Process by going to Setup > Create > Workflow & Approvals > Process Builder and click the New button.

Give the process a name, description, and choose to start the process when "A record changes".

Click Save, and then select "Add Criteria".

Next choose the object you are starting the process from. Remember in this guide, we are using the Case object, and we will be running the shipment creation when Status = "Return Label Authorized".

Next add an immediate Action. The Action Type will be "Apex", and the Apex Class will be "Create Shipment (Multi Carrier)".

For the customAddressId please set it to the Custom Address Source ID that you are running this process from. To get this ID, navigate to your Custom Address Source and copy the last part of the URL. If you are in Lightning just use the first 15 characters of this objectId.

For the recordId please set the Type as Field Reference, and the value to be the Object ID. In our case it will end up being the Case ID.

Once set up correctly, it should look like this:

Click Save, and don't forget to Activate this Process Builder.

That is all set, you will now be able to have shipments created via process builder.

Once you have activated the process builder, go to an Case, change its Status to "Return Label Authorized" and a shipment will be auto-created.

Emailing Labels

Our invocable method allows you to automatically send a Multi Carrier label via email as an attachment.

This only works when used in conjunction with our Invocable - Create Shipment method.

Step 1. Create Process

First create a Process Builder Process by going to Setup > Create > Workflow & Approvals > Process Builder and click the New button.

Give the process a name, description and choose to start the process when "A record changes".

Next, click "Add Object", choose the Shipment object and we want to start the process "when a record is created or edited".

Click Save and your screen will look like so:

Next we select "Add Criteria".

On the right hand side set the Condition Field to be "Shipment Processing Completed"

and the value we are looking for to be True.

We also need to check the checkbox under advanced to execute the actions only when specified changes are made to the record.

You should finish with a screen like so:

Alternative Method

The 2nd way to be able to access scheduled actions is to go back a few steps and change the process to start "only when a record is created." The advanced criteria option to execute actions only when specified changes are made to the record won't be available or necessary.

Click Save, and click "Set Schedule", input 0 Hours After Last Modified Date or you can select Created Date if you chose to run the process only when a record is created.

Click save, and click "Add Action", set the Action Type to be "Apex", and the Apex Class to be "Send Labels to Email":

You will then need to set the Apex variables. There is only one to set.

Choose the Type "Field Reference", and select "Record ID" from the field dropdown.

Your screen will now look like so:

Click Save, and then activate the Process Builder process.

You can now test this procedure.

Create a Shipment, using the invocable method we have created previously.

Troubleshooting

The email gets sent to either the sender email address and/or recipient email address. To set which one it gets sent to, please edit the Preference and edit these fields:

Please contact us using the icon to the bottom right of this screen if you have any queries, and we will be glad to help.

Calculating Rates

Our invocable method allows you to create a rate request from any object that you have set up a Custom Address Source for using Process Builder. If you haven't set up a Custom Address Source then please follow this guide that explains how to do so.

In this example we will create a rate request from an Opportunity object when the Status field on the Opportunity gets set to "Proposal/Price Quote".

Step 1. Add 4 fields onto your object

Add 4 custom fields onto your object (Opportunity in our case) where you will store the returned rate information.

We recommend something like this:

Step 2. Set all required fields in your Custom Address Source

In your Custom Address Source you will need to have these items set as a minimum*:

Recipient Address Fields

  • Name Field
  • Street 1 Text Line Field
  • City Field
  • State Field
  • Postal Code Field
  • Country Field
  • Phone Field

Billing Field

Payment Type Field: the value of this field can be set to SENDER, RECIPIENT, THIRD_PARTY

Preference

Preference Name Field: the value of this field can be set to the name of the preference (e.g. "ShipmatePreference-0000")

Ship Date* (only required for FedEx)

Ship Date Field : ensure this is a date field. If you want to use todays date, just add this value to the formula field - TODAY()

Service Types

Service Type Field: such as FEDEX_2_DAY, FEDEX_GROUND, FIRST_OVERNIGHT. (FedEx Service Type Examples)

Package Types

Package Type Field: such as FEDEX_BOX, FEDEX_ENVELOPE, YOUR_PACKAGING. (FedEx Package Type Examples)

Packages

You must add at least one package row. Fields needed are Quantity, Weight, and Declared Value.

Output Fields

This section defines which fields on your original object (in our case the Opportunity object), you would like the rate information that is returned to be populated to.

  • Output Delivery Date Field: Expected delivery date
  • Output Delivery Day Of Week Field: Expected Delivery day of the week
  • Output Service Name Field: Service Type that was chosen
  • Output Delivery Days Field: Number of days to deliver
  • Output Net Charge: Estimated shipment cost

Step 3. Process Builder Task

Create a Process Builder Task by going to Setup > Create > Workflow & Approvals > Process Builder and click the New button.

Give the process a name, description and choose to start the process when "A record Changes".

Next choose the object you are starting the process from. Remember in this guide, we are using the Opportunity object, and we will be running the shipment creation once the Opportunity StageName gets set to "Proposal/Price Quote".

Make sure you set to "Start the process" to be "when a record is created or edited". Click Save, and then select "Add Criteria".

Fill in your requirements for when the shipment process should start. In this guide we are going to check that the Opportunity StageName gets set to "Proposal/Price Quote".

Click Save.

Next add an Immediate Action. The Action Type will be "Apex", and the Apex Class will be "Get Rate".

You will then be able to set the Apex Variables.

For the customAddressId please set it to the Custom Address Source ID that you are running this process from. To get this ID, navigate to your Custom Address Source and copy the last part of the URL. If you are in lightning just use the first 15 characters of this objectId.

For the recordId please set the Type as Field Reference, and the Value to be the Object ID. In our case it will end up being the Opportunity ID.

Your screen will now look like this:

Click Save, and don't forget to Activate this Process Builder.

That is all set, you will now be able to have rates information populated back onto your object via Process Builder.

Once you have activated the Process Builder, go to an Opportunity, change its Status to “Proposal/Price Quote” and your rate information will appear on your object.

Tracking Shipments

Our invocable method allows you to create a Multi Carrier Shipment object as long as you have a Tracking Number and the Ship Date* (only required for FedEx).

You also need to create a lookup relationship and have Custom Address Source object set up. Here are the steps to create a lookup relationship and Custom Address Source.

This can be achieved using Process Builder and our standard Multi Carrier for Salesforce App.

For this guide we will work from an Opportunity object.

Step 1: Create Fields

Firstly make sure you have two custom fields available on the Opportunity object where the user will add the tracking number (Type: Text, Length 100) and the shipment date (Type: Date):


Step 2: Create Process Builder Process

Create a Process Builder Process by going to Setup > Create > Workflow & Approvals > Process Builder and click the New button.

Give the process a name, description, and choose to start the process when "A record changes".


Next choose the object you are starting the process from. Remember in this guide, we are using the Opportunity object, and we will be running the shipment creation once the Opportunity object has the Tracking Number and Ship Dates filled.


Make sure you set "Start the process" to be "when a record is created or edited". Click Save, and then select "Add Criteria".

We need to look out for three conditions to be met.

  1. Tracking Number has been changed
  2. Tracking Number is not null
  3. Ship Date is not null

This is how your page will look:


Click Save.

Next add an Immediate Action. The Action Type will be "Apex", and the Apex Class will be "Track Shipment".


There are now 2 Apex variables that need to be set, and up to 6 variables that can be set. Below is an explanation of each one:

preferenceId - this is the Preference ID

trackingNumber - this is the tracking number you want to track

shipDate - the date this tracking number was created

recordId - the Opportunity ID (in this case)

createShipmentIfNotFound - if set to True, a new shipment object will be created if the tracking number does not already exist as a shipment on Salesforce

customAddressId - if you want to relate this shipment to your Opportunity (in this case) you need to specify the Custom Address Source ID, so that the link can be made.

For the customAddressId please set it to the Custom Address Source ID that you are running this process from. To get this ID, navigate to your Custom Address Source and copy the last part of the URL. If you are in Lightning just use the first 15 characters of this objectId.


For the recordId please set the Type as Field Reference, and the value to be the Object ID. In our case it will end up being the Opportunity ID.

Once all these fields have been added your screen will look like this:


Click Save, and don't forget to Activate this Process.

That is all set, you will now be able to have shipments created via process builder for tracking.

Once you have activated the process builder, go to an Opportunity object, add the tracking number and ship date and the shipment will be auto-created.

Troubleshooting

If you have missed a step and the shipment isn't created, you can view error messages under Setup > Jobs > Apex Jobs.

The error messages are extremely helpful for debugging.

Please contact us using the icon to the bottom right of this screen if you have any queries, and we will be glad to help.

Using Flows Instead of Procees Builders

If you have advanced logic that is better served using Flows, then our Invocable Methods from the guide above are all still accessible via the Flow interface.

Once you are editing your flow select to add an Action:

You will then need to scroll down to Uncategorized, and then in the search section do a search for Multi Carrier. You can now select the type of method to use.

You are then able to enter the same inputs as you would do using process builder.

If you have any questions please do not hesitate to contact us.