Summary: A business rule that fills in an address by looking up a code fails when it runs on a shipment that does not carry that code. Two shipments to the same address can behave differently for this reason. Add a check so the rule only fires when the code is there.

Problem

One shipment processes and a nearly identical one to the same Ship To address fails. The message reads:

No address found for code. Exception applying business rule set action.
(Source: ApplyBusinessRule (Set Field))

Cause

You have a business rule with a Set Field action that fills in an address by code. A common example is a rule that sets a third-party Bill To address from a code carried on the order in a user-defined field (a UDF, an extra field your order system fills in).

The rule reads that field, looks for a matching address, and fills it in. When the rule fires on a shipment that does not carry the code, the lookup finds nothing and throws the message above. A Prepaid shipment is the usual case: it never carries a third-party code, so the field is empty, but the rule still fires on it.

The shipment that worked carried the code the rule expects. The one that failed did not.

How to check: compare the two shipments on the billing terms and on the field the rule reads. On the one that failed, the field is empty or the terms are different.

Fix

  1. Find the business rule named in the message. It is the one with a Set Field action that sets an address by code.
  2. Open the shipment that failed and look at two things: its billing terms, and the field the rule reads. On the failing shipment one of them will not match what the rule expects.
  3. Add a criterion to the rule so it only fires when the code is there. Either exclude Prepaid shipments, or require the field the rule reads to be filled in.
  4. Click Save.
  5. Or, instead of changing the rule, send the shipment with the terms and the address code the rule expects, the same way the shipment that worked was sent.
  6. Process the shipment again.

What you should see

The shipment that was failing processes with no No address found for code message, and shipments that should not trigger the rule no longer do.

If something goes wrong

You are not sure which rule it is. More than one rule can set an address. Turn off the rules that set addresses one at a time and process the shipment after each, until it goes through.

The order system is sending the field empty when it should not. That is a mapping problem in the order system, not in the rule.

You cannot open the rule. Editing rules takes admin permissions. Email support@shipstore.com with your company name, the exact message, and the shipment number.

Related articles

  • Prepaid shipment flips to Bill Consignee (invalid account number)
  • How Business Rule precedence works (default, global, profile)
  • Broker Info rule throws an error on the wrong profile