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 :
Microsoft Dynamics AX (Archived)

Update CustCustomerService causes "Document Customers could not be updated. Error Details: Entity update mode must be specified."

(0) ShareShare
ReportReport
Posted on by

It appears there's no real solution that I can find for this problem.

I have updateMode specified but it still tells me that Entity update mode must be specified. I'm just looking to change the street for the delivery address of the customer account.

        static void UpdateAddress()
        {
            MyCustCustomerService.CustomerServiceClient updateClient = new MyCustCustomerService.CustomerServiceClient();
            MyCustCustomerService.CallContext updateCC = new MyCustCustomerService.CallContext();
            updateCC.PartitionKey = ConfigurationManager.AppSettings["Partition"];
            updateCC.Company = ConfigurationManager.AppSettings["Company"];
            MyCustCustomerService.AxdCustomer updateCustResp;

            MyCustCustomerService.EntityKey[] readUpdateCustKeys = new MyCustCustomerService.EntityKey[1];
            readUpdateCustKeys[0] = new MyCustCustomerService.EntityKey();
            readUpdateCustKeys[0].KeyData = new MyCustCustomerService.KeyField[1];
            readUpdateCustKeys[0].KeyData[0] = new MyCustCustomerService.KeyField();
            readUpdateCustKeys[0].KeyData[0].Field = "AccountNum";
            readUpdateCustKeys[0].KeyData[0].Value = "US-012";

            updateCustResp = updateClient.read(updateCC, readUpdateCustKeys);

            updateCustResp.CustTable[0].DirParty[0].DirPartyPostalAddressView[0].updateMode = MyCustCustomerService.AxdEnum_ValidTimeStateUpdate.Correction;
            updateCustResp.CustTable[0].DirParty[0].DirPartyPostalAddressView[0].updateModeSpecified = true;
            //updateCustResp.CustTable[0].DirParty[0].DirPartyPostalAddressView[0].action = MyCustCustomerService.AxdEnum_AxdEntityAction.update;
            //updateCustResp.CustTable[0].DirParty[0].DirPartyPostalAddressView[0].actionSpecified = true;
            updateCustResp.CustTable[0].DirParty[0].DirPartyPostalAddressView[0].RecId = updateCustResp.CustTable[0].DirParty[0].DirPartyPostalAddressView[0].RecId;
            updateCustResp.CustTable[0].DirParty[0].DirPartyPostalAddressView[0].RecVersion = updateCustResp.CustTable[0].DirParty[0].DirPartyPostalAddressView[0].RecVersion;
            updateCustResp.CustTable[0].DirParty[0].DirPartyPostalAddressView[0].Street = "678 Orange St";

            updateClient.update(updateCC, readUpdateCustKeys, updateCustResp);
        }

I've tried it with update action; however, it says action cannot be specified.

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    You are trying to write data in a view (DirPartyPostalAddressView). You must do that in the source record.

    Let me quote the documentation: msdn.microsoft.com/.../bb314551.aspx

    "Views are read-only. The data fields and tables that a view uses cannot be updated from that view."

  • Community Member Profile Picture
    on at

    Thanks Vilmos,

    What's the recommended way to change the address? I found this but it pertains to AX 2009:

    blogs.msdn.microsoft.com/.../updating-customers-via-the-customer-aif-service

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    i am afraid I cannot give you the exact details via the document services. However normally the link for address is DirPartyTable - DirPartyLocation - LogisticsLocation - LogisticsPostalAddress, I hope this helps.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans