background

Zenkraft Blog

Run your Logistics and Post-Purchase Experience on the Salesforce Platform.

Create a scheduled job code to delete any FedEx checkpoints for shipments that have been delivered more than 2 week ago

Published on 04 October 2017 by in  

Todays blog post will show you the code needed to set up a scheduled job that will remove all FedEx checkpoint objects for shipments that have been delivered more than 2 weeks ago.

This is useful if you are coming up against salesforce storage limits and need to clear out some space.

We will need to create two classes and then their respective test classes.

RemoveDeliveredCheckpointsBatch

This class creates the list of all the checkpoints that need to ...

Continue reading »

Bulk Cancel UPS shipments

Published on 18 July 2017 by in  

A quick code snippet for you today, if you want to cancel all UPS shipments that have not been picked up.

Here is the code to run in Developer Console:

Line 4 determines the shipments we want to set as cancelled. For this snippet we have decided to cancel all shipments older than UPS-Shipment-0000001000.

Line 7 then uses our startMassShipmentCancelBatch process that goes ...

Continue reading »

UPS Address validation on an Account

Published on 23 May 2017 by in  

Today's blog post will show the code you need to validate an Account address via the UPS Address Validation call you can find in the UPS Shipmate app.

Firstly we will look at the Controller code, and we will explain how it works below:

Lines 7-12: This is where you specify the name of the Account object that you want to validate the address for.

Lines 14-27: We need to get the...

Continue reading »