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?
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.
Please check if the below set up helps you.
anithasantosh.wordpress.com/.../
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
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.
Hi Anitha,
It works for me, thank you so much!
Hi Alireza,
It worked, the party has been deleted. Many thanks!
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 696 Super User 2025 Season 2
CA Neeraj Kumar 569
Martin Dráb 551 Most Valuable Professional