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
Id shipmentId = 'xxxxxxxxxxxxxxx'; | |
zkmulti__MCShipment__c ship = zkmulti.ShipmentInterface.cancelShipment(shipmentId); | |
if (ship.zkmulti__Shipment_Deleted__c) { | |
System.debug('shipment was canceled successfully'); | |
} else { | |
// check status | |
zkmulti__Shipment_Status__c statuses = [ | |
SELECT | |
zkmulti__Status__c, zkmulti__Status_Message__c, zkmulti__Timestamp__c FROM zkmulti__Shipment_Status__c | |
WHERE zkmulti__Shipment__c =:shipmentId |
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
Id prefId = 'a025800000bs9Qx'; | |
Id userId = UserInfo.getUserId(); | |
List<Id> attIds = new List<Id>(); | |
attIds.add('00P4I00001124w1'); | |
attIds.add('00P4I00001124lS'); | |
List<Attachment> attachments = [SELECT Id, ParentId, Name, ContentType, Body FROM Attachment WHERE Id IN :attIds]; | |
List<String> statuses = zkmulti.ShipmentInterface.printLabels(attachments, prefId, userId); |
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 class FedexQueuedShipmentStatusTriggerHandler { | |
public static Boolean enableTrigger = true; | |
public static void updateValidationIfError(Map<Id, zkfedex__QueuedShipmentStatus__c> newMap) { | |
Set<Id> errorsSet = new Set<Id>(); | |
Boolean isContinue = false; | |
for (zkfedex__QueuedShipmentStatus__c qss : newMap.values()) { | |
if (qss.zkfedex__Status__c == 'ERROR') { | |
errorsSet.add(qss.Id); | |
} |
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
trigger FedexQueuedShipmentStatusTrigger on zkfedex__QueuedShipmentStatus__c(after delete, after insert, after undelete, after update, | |
before delete, before insert, before update) { | |
if (FedexQueuedShipmentStatusTriggerHandler.enableTrigger) { | |
if (Trigger.isAfter && Trigger.isInsert) { | |
FedexQueuedShipmentStatusTriggerHandler.updateValidationIfError(Trigger.newMap); | |
} | |
} | |
} |
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 class FedexShipmentService { | |
public static zkfedex__ShipmatePreference__c shipmatePreference { | |
get; | |
set; | |
} | |
public static BulkShipmentSettings__c settings { | |
get; | |
set; | |
} | |
public static zkfedex__QueuedShipment__c createQueuedShipment(String bulkShipmentId, Account currentAccount) { |
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 class AccountTriggerHandler { | |
public static Boolean enableTrigger = true; | |
public static void createShipments(Map<Id, Account> oldMap, Map<Id, Account> newMap) { | |
Set<Id> AccountsToProcessFedexSet = new Set<Id>(); | |
for (Account currentAccount : newMap.values()) { | |
if (currentAccount.Create_FedEx__c == true && | |
currentAccount.Create_FedEx__c != oldMap.get(currentAccount.Id).Create_FedEx__c) { | |
AccountsToProcessFedexSet.add(currentAccount.Id); | |
} |
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
trigger AccountTrigger on Account(after delete, after insert, after undelete, after update, | |
before delete, before insert, before update) { | |
if (AccountTriggerHandler.enableTrigger) { | |
if (Trigger.isAfter && Trigger.isUpdate) { | |
AccountTriggerHandler.createShipments(Trigger.oldMap, Trigger.newMap); | |
} | |
} | |
} |
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
Id prefId = 'a025800000Zr2jJ'; // your DHL preference | |
Id contactId = '00358000006wy1I'; // you contact record | |
zkmulti__MCShipmate_Preference__c shipmatePref = [ | |
SELECT Id, Name, zkmulti__AccountNumber__c, | |
zkmulti__Carrier__c, zkmulti__Label_Image_Type_Default__c, | |
zkmulti__Billing_City__c, zkmulti__Billing_Country__c, zkmulti__Billing_State__c, | |
zkmulti__Billing_Street__c, zkmulti__Billing_Zip_Postal_Code__c, zkmulti__Company_Name__c, zkmulti__Sender_Email_Default__c, zkmulti__Sender_Name_Default__c, | |
zkmulti__Sender_Phone_Default__c, zkmulti__Shipping_City__c, zkmulti__Shipping_Country__c, zkmulti__Shipping_Is_Residential__c, | |
zkmulti__Shipping_State__c, zkmulti__Shipping_Street__c, zkmulti__Shipping_Zip_Postal_Code__c, zkmulti__Currency_Default__c |
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
Id prefId = 'a025800000bs9Qx'; //Your FedEx Preference | |
Id contactId = '00358000006wy1I'; // Jack Rodgers | |
zkmulti__MCShipmate_Preference__c shipmatePref = [ | |
SELECT Id, Name, zkmulti__AccountNumber__c, | |
zkmulti__Carrier__c, zkmulti__Label_Image_Type_Default__c, | |
zkmulti__Billing_City__c, zkmulti__Billing_Country__c, zkmulti__Billing_State__c, | |
zkmulti__Billing_Street__c, zkmulti__Billing_Zip_Postal_Code__c, zkmulti__Company_Name__c, zkmulti__Sender_Email_Default__c, zkmulti__Sender_Name_Default__c, | |
zkmulti__Sender_Phone_Default__c, zkmulti__Shipping_City__c, zkmulti__Shipping_Country__c, zkmulti__Shipping_Is_Residential__c, | |
zkmulti__Shipping_State__c, zkmulti__Shipping_Street__c, zkmulti__Shipping_Zip_Postal_Code__c, zkmulti__Currency_Default__c |
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 without sharing class BotReturnOrder { | |
@InvocableMethod(label='Bot Return Order') | |
public static List<Response> returnOrder(Request[] requests) { | |
List<Response> resp = new List<Response>(); | |
String orderNumber = requests[0].orderNumber; | |
Response r = new Response(); | |
return resp; | |
} |
NewerOlder