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 through all the shipments and cancels them.
Please contact us if you have any questions and we will be glad to help.