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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Change usertype at customer

(0) ShareShare
ReportReport
Posted on by 200

I have an integration where I receive customers from a portal. They are created or updated in D365FO with the usertype from the portal using entity custCustomerV3Entity

From time to time the usertype changes from Organization to Person or reverse.

If I try to update the customer with this new Usertype I receive an error 
Cannot update a party's type from 'DirOrganization' to 'DirPerson', a delete of the existing party followed by an insert with the new type should be performed instead.

I have tried to create a new dirpartytable with DirPartyTable::createNew but it seems s if the old dirpartytable record is still in use.

CustTable custtable = CustTable::find(customer.CustomerAccount,true);
custTable.Party = DirPartyTable::createNew(DirPartyType::Person,'').RecId;
custTable.doUpdate();

have anyone a suggestion on how to change the  usertype

Thanks in advance

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Erik,

    You can read my blog how to perform this change from the user interface. The blog was written for AX 2012, but still valid for Dynamics 365.

    dynamicspedia.com/.../

    In your coding you only create a new DirPartyTable record, but you didn't delete the old one. Before deletion, you might copy some name, address and contact details. Then also perform a check if the party was not linked to another role.

  • Verified answer
    ErikKornerup Profile Picture
    200 on at

    Thank you.

    It was an inspiration but not quite what I needed. I have also tried to create a new dirparty record an delete the old onbe. That did not help.

    I have received  this article : https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/141886/job-to-change-customer-partytype/310100 and that did the trick.

    Thank you for responding

    /Erik Kornerup

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 584 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 254 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans