The wrong Return To address prints when a rule fires
Summary: The Return To address prints wrong when another business rule fires because nothing sets the Return To. Add a Set Return To action that pulls the full address from the address book, and run it before rates so it also covers manual shipments.
Problem
The Return To address prints wrong on labels. It looks right when you test by hand, but when another business rule fires (for example a rule that switches carrier by box size), the Return To prints the wrong address, such as an inventory location or a bill-to address.
Cause
Nothing sets the Return To, so the shipment uses the address that came in with the order (the wrong bill-to or inventory address). A first fix attempt can miss because it sets only the address code instead of pulling the full address record, and because it runs only after the order loads, so it skips manual shipments.
How to check: If the Return To is right on a manual shipment but wrong when a rule fires, no rule is setting the Return To.
Fix
- Go to Admin > Business Rules and open (or add) the rule.
- Add a Set Return To action.
- Set it to set the entire address from the address book where value = [address book code], so the full Return To address is pulled, not just the address code.
- Change the rule event from After Shipment Loads to Before Shipment Rates so it applies to manual shipments as well as loaded orders. Switch back if your case needs After Shipment Loads.
- Click Save and re-test both a manual shipment and a loaded order.
What you should see
The correct Return To address prints on a manual shipment and on a loaded order, even when the box-size or profile-switch rule fires.
Related articles
- Business Rules