Last active
August 1, 2025 22:45
-
-
Save megasmack/7ac413e4b8354b28c0a91381ce06bb8c to your computer and use it in GitHub Desktop.
APEX Method to update cartDeliveryGroups
This file contains hidden or 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 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