Why duplicate company records appear on EDI orders
When a new EDI 850 purchase order arrives, Luminous automatically tries to link it to an existing company (Business Account) in your CRM. It does this by:
- Looking for a company whose contact email matches the email on the order.
- If no email match is found, looking for a company whose name exactly matches (case-insensitive) the company name on the billing or shipping address of the order.
- If neither matches, creating a new company record automatically.
The most common cause of duplicates is when a retailer or trading partner sends slightly different company names on each order — for example, TARGET DC 3857 on one order and TARGET DC 0589 on another. Because neither matches an existing TARGET record exactly, Luminous creates a separate company for each.
Step 1 — Enable the CRM sync on your EDI channel
The company-matching logic only runs when the Save contact to CRM from orders option is turned on for your channel.
- Go to Manage → Channels and open your EDI channel.
- Scroll to the Order Source section.
- Turn on the Save contact to CRM from orders toggle.
- Save the channel.
Once this is enabled, a Company name matching section appears below the toggle.
Step 2 — Configure company name matching to prevent duplicates
The Company name matching panel lets you define a pattern that extracts a consistent CRM lookup name from whatever name appears on incoming orders.
Option A — Let Luminous analyze your orders automatically (recommended)
- In the Company name matching panel, click Analyze orders from this channel.
- Luminous will examine recent order company names and suggest a matching pattern. The suggestion may come from a built-in heuristic or from AI analysis, and both will be labeled clearly.
- Review the Preview table, which shows each recent order company name alongside the CRM lookup name that would be extracted.
- If the suggested pattern looks correct, save the channel.
Option B — Enter a pattern manually
If the automatic suggestion isn't quite right, expand Advanced: matching pattern and type your own pattern.
- The pattern must be a PHP-style regular expression wrapped in forward slashes, e.g.,
/^(TARGET) DC \d+$/i - It must include a capture group (text inside parentheses). The text captured by that group is what Luminous will use to search your CRM — for example,
TARGET. - If the pattern matches but the capture group doesn't fire, no substitution is made and the raw name is used as-is.
- The CRM lookup is case-insensitive, so
TargetandTARGETwill resolve to the same company.
The preview table updates in real time as you type, so you can confirm the pattern behaves as expected before saving.
How the matching logic works at order time
Once a pattern is saved, every time an EDI order arrives Luminous:
- Reads the company name from the billing address (falling back to the shipping address if billing has no valid company name).
- Runs your pattern against that name.
- Uses the captured text as the CRM lookup name.
- Searches for a Business Account with that name (exact match first, then case-insensitive).
- If a match is found, links the order to that existing company — no new record is created.
- If no match is found, creates a new company using the captured (canonical) name.
Manually reassigning the company on an existing order
If orders were already imported before the matching rule was set up, you can correct the company association directly on the sales order:
- Open the sales order (go to Operations → Sales Orders and click the order).
- Click Edit.
- In the Company field at the top of the form, clear the current value and search for the correct Business Account.
- Select the right company from the dropdown.
- Save the order.
Luminous will update the company link on that order immediately. Any custom fields, fulfillment priority lists, and partial-order settings configured on the selected company will also be applied to the order at that point.
Tips
- Test before going live: Use the preview table in the Company name matching panel to verify your pattern against real order names before saving.
- Pattern not matching? Make sure the pattern includes a capture group (parentheses around the part you want to extract) and that it's wrapped in forward slashes.
- Orders with no company name or email: If an order arrives with neither a company name nor an email address, Luminous cannot create or match a company and will leave the order unlinked. Use the manual reassignment steps above to fix those orders.