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

Community site session details

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

How to delete a party which has Primary Address

(0) ShareShare
ReportReport
Posted on by 10

Hi,

I am using D365 FO(10.0.31)

I want to delete a party but the party has a primary address and the system does not allow me to delete.

This party does not have any associated role.

How can I delete this party?

pastedimage1675934514147v1.png

pastedimage1675934552001v2.png

pastedimage1675934598488v3.png

I have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at
    RE: How to delete a party which has Primary Address

    Hi Vivian, This is a standard validation which does not allow Deletion if there is related primary Address record in LOGISTICSPOSTALADDRESS and DIRPARTYLOCATION table.

    Deleting the related record in these two tables will allow to delete the Party. The relation is on Location Id which you can get by clicking on More options-->Advanced (under Address Tab in Party form).

    If this Party record is in production then even though its a simple sql script, before deleting the records, test your script first in Dev & Test environment as usual. Hope it helps.

  • Verified answer
    AnithaEswaran Profile Picture
    2,032 on at
    RE: How to delete a party which has Primary Address

    Hi,

    Please check if the below set up helps you.

    anithasantosh.wordpress.com/.../

  • Verified answer
    Alireza Eshaghzadeh Profile Picture
    14,672 Super User 2025 Season 2 on at
    RE: How to delete a party which has Primary Address

    Hi Vivan,

    You can follow following workaround that has been suggested by Andre Arnaud de Calavon 

    I have tested and it works fine. 

    community.dynamics.com/.../1314381

  • Vivian Wei Profile Picture
    10 on at
    RE: How to delete a party which has Primary Address

    Hi Mohit, thanks for your quick reaction.

    I deleted the realated record in both LOGISTICSPOSTALADDRESS and DIRPARTYLOCATION tables, but I still cannot delete the party. It told me "Primary address cannot be deleted" again.

  • Vivian Wei Profile Picture
    10 on at
    RE: How to delete a party which has Primary Address

    Hi Anitha,

    It works for me, thank you so much!

  • Vivian Wei Profile Picture
    10 on at
    RE: How to delete a party which has Primary Address

    Hi Alireza,

    It worked, the party has been deleted. Many thanks!

  • Mohit Rampal Profile Picture
    12,565 Moderator on at
    RE: How to delete a party which has Primary Address

    Hi Vivian, I have tested deleting those records works for me. However, try other suggestions as it doesn't involve SQL scripts so even better solution. If still doesn't work then please provide more information so we can help.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 563 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans