web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Delete Duplicate Customer addresses and update SO Lines with primary AddressLocationID

(3) ShareShare
ReportReport
Posted on by 2,326
Hi,
 
While importing Sales Order Lines through DMF, there were multiple duplicate Customer Postal Addresses were created for each customer.
 
Now I want to just keep the primary addresss on each customer and delete the duplicate addresss. And then update the address on the Sales Order header and line.
 
I manually deleted some of the duplicate addresses, due to which some of the sales orders have the confirm button disabled. Also when I manually update the line address, the status becomes cancelled. How to avoid this? I want to update the existing line with the line status being "Open Order" and not becoming "Cancelled".
 
Appreciate any tips.
 
Thanks.
Categories:
I have the same question (0)
  • CU19011229-0 Profile Picture
    2 on at
    Hi, You should avoid manually deleting addresses; instead, mark duplicates as inactive and update sales orders via a proper data management process VerveCard
  • Suggested answer
    David Ali Profile Picture
    on at

    Hi,

    This is standard D365FO behavior.

    When Sales Orders are imported via DMF, postal addresses are referenced on the Sales Order header and lines. Per Microsoft Learn (“Global address book overview”, “Address framework overview”), postal addresses that are used on transactions must not be deleted. Deleting them breaks the address reference and results in actions like the Confirm button being disabled.

    Changing the delivery address on an Open Order sales line is treated as a commercially significant change. As described in “Sales order processing overview” and “Sales order statuses”, this causes the system to cancel the existing line rather than update it in place.

    Recommended approach:

    • Do not delete used postal addresses; expire duplicates instead (remove Primary flag, set Valid to date).

    • There is no supported way to change the delivery address on open sales lines and keep the status Open Order once the original address is deleted.

    • The safe solution is to cancel and recreate unconfirmed sales orders with the correct customer primary address.

     

    Thanks

    David Ali

  • Verified answer
    Encore Business Solutions Profile Picture
    74 on at

    Hi,
    You are on the right track in wanting to eliminate duplicate records.  However, deleting always has the potential to abandon records.

    You’ll need to look to the Global address book for your solution.  In the Global address book, you will find Party IDs for each address.  The Global address book has a feature to Merge records.  By merging the records you should not abandon the SO Lines (which is what is triggering the Cancelled status).

    The Global address book also has a feature you might try, called Check for duplicates.

    Of course you want to prove that these features will work for you in TEST, and create a backup of PROD, before undertaking in PROD.

    If your list of duplicates is extensive, a developer can create a routine for the Merge records feature to automate the process.

  • André Arnaud de Calavon Profile Picture
    302,672 Super User 2026 Season 1 on at
    Hi MYGz,
     
    I tried to reproduce your scenario, but when I change the address on the header and lines, the lines and the order are not cancelled. They remain in the status of open order. This is also the expected behavior. 
    Initially, after deleting the address, the order is correctly stating that the used address is not effective anymore.
     
    Can you tell if the orders are in the open order status? What exact data entity did you use? Are there any other specific settings changed, like disabling of business logic when importing the data? Can you check if the sales order lines do have a corresponding inventory transaction before changing the address?

     
  • André Arnaud de Calavon Profile Picture
    302,672 Super User 2026 Season 1 on at
    @David Ali,

    Can you tell us if you validated the reply you shared?
    The “Global address book overview” does not talk about deletion of addresses. There is no Microsoft learn article with the topic "Address framework overview".
    You mentioned that something is described in “Sales order processing overview" and “Sales order statuses”. Please share the links as I have not seen the information before you are referring to.
  • MYGz Profile Picture
    2,326 on at
     
    Attaching the data entities along with the sample records exported. I have highlighted the error records with yellow and obfuscated some data. Let know if you can identify something.
     
    Sales order headers V3
     
    Sales order lines V2
     
    I have good records created manually and the bad records created with DMF.
    For now, I went with the below approach, is it correct?
     
    1. Set Expiration = Effective date in customer postal address for records with Primary = No. And run Delete Inactive addresses to remove duplicates.
    2. Delete and Reimport Bad Sales order header and Lines (where confirm button is disabled) with Correct PrimaryAddressLocationID.
    3. Update the good sales order and lines with PrimaryAddressLocationID since some of the secondary addresses are setup on these orders (When updating on good records, the status doesn't changes to cancelled)
     
    Thanks for the solution, but I went with a different approach above.
     
    Yes thats how I deleted them.
  • Verified answer
    André Arnaud de Calavon Profile Picture
    302,672 Super User 2026 Season 1 on at
    Hi MYGz,
     
    When you delete an address directly, it will also set an expiry date. It doesn't actually remove the record from the application. For step 1, this is an option, but deleting is possible as well.
     
    For the second step, have you first checked if for all sales order lines the related inventory transaction does exist? If not, you might have the issue you are facing that the status will be changed. Anyway, delete and re-import is an option.
    What is the difference between a good and bad sales order? Are there orders where the change of the address did not set the line to canceled?
     
     
  • MYGz Profile Picture
    2,326 on at
     
    There is no Packing Slip on any of the Sales Order yet, at Max few Sales Orders are in confirmed state, nothing beyond that.  So do you think my approach is fine?
     
    Yeah, the ones created manually are the good orders with no issues in changing addresss, i.e status remains "Open order" after changing address on lines.
  • Verified answer
    André Arnaud de Calavon Profile Picture
    302,672 Super User 2026 Season 1 on at
    Your workaround will work. However, as mention check in the "bad" sales orders if the inventory transactions are created for the order lines. You haven't told me if you checked this already or not. 
  • MYGz Profile Picture
    2,326 on at

    I checked the inventory transactions from "Inventory & Management" > "Inquiries and Reports" > "Inventory Transactions"
    And I found there are transactions available for the sales orders that I deleted. The created date is earlier when I uploaded it first. And modified date is a later time.
     
    Will these transactions be Orphaned since the Sales Order was deleted?
    Or reimporting the sales order will relink these transactions to the new sales order based on sales order number which remained the same.
     
    Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 650 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 287 Super User 2026 Season 1

#3
Martin Dráb Profile Picture

Martin Dráb 225 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans