Skip to content

Instantly share code, notes, and snippets.

@megasmack
Last active August 1, 2025 22:45
Show Gist options
  • Select an option

  • Save megasmack/7ac413e4b8354b28c0a91381ce06bb8c to your computer and use it in GitHub Desktop.

Select an option

Save megasmack/7ac413e4b8354b28c0a91381ce06bb8c to your computer and use it in GitHub Desktop.
APEX Method to update cartDeliveryGroups
public without sharing class B2BCheckout {
@AuraEnabled
public static CartDeliveryGroup setPickupInformation(String notes, String pickupTime, Id cartDeliveryGroupId) {
CartDeliveryGroup cartDeliveryGroup = [
SELECT Id, DeliveryMethodId
FROM CartDeliveryGroup
WHERE Id =: cartDeliveryGroupId
];
Datetime desiredDeliveryDate = Datetime.valueOfGmt(pickupTime.replace('T', ' '));
cartDeliveryGroup.ShippingInstructions = notes;
cartDeliveryGroup.DesiredDeliveryDate = desiredDeliveryDate;
update cartDeliveryGroup;
return cartDeliveryGroup;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment