Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How to update a customer data using soap request ?

(0) ShareShare
ReportReport
Posted on by 40

Hi Expert ,

   I have used add data(Customer/Product/ReleaseProduct/SalesOrder) in Dynamics AX 2012 using inbound port with  htp  soap request . Now i want to update that entity data but i can't find any reference document for update data where i need what are primary entity keylist for that entity. I am trying to update customer as below format but getting error  : 

Request ACtion : schemas.microsoft.com/.../update

Request Body : 

<s:Envelope xmlns:s="">schemas.xmlsoap.org/.../">
<s:Header>
<h:CallContext xmlns:h="">schemas.microsoft.com/.../datacontracts" xmlns="">schemas.microsoft.com/.../datacontracts" xmlns:xsi="">www.w3.org/.../XMLSchema-instance" xmlns:xsd="">www.w3.org/.../XMLSchema">
<Company>dat</Company>
</h:CallContext>
</s:Header>
<s:Body xmlns:xsi="">www.w3.org/.../XMLSchema-instance" xmlns:xsd="">www.w3.org/.../XMLSchema">
<CustomerServiceUpdateRequest xmlns="">schemas.microsoft.com/.../services">
<EntityKeyList xmlns="">schemas.microsoft.com/.../EntityKeyList">
<EntityKey xmlns="">schemas.microsoft.com/.../EntityKey">
<KeyData>
<KeyField>
<Field>AccountNum</Field>
<Value>W31</Value>
</KeyField>
</KeyData>
</EntityKey>
</EntityKeyList>
<Customer xmlns="">schemas.microsoft.com/.../Customer">
<CustTable class="entity">
<DirParty xsi:type="AxdEntity_DirParty_DirPerson" class="entity">
<PartyNumber>000001889</PartyNumber>
<PersonName class="entity">
<FirstName>Test</FirstName>
<LastName>w31</LastName>
</PersonName>
</DirParty>
</CustTable>
</Customer>
</CustomerServiceUpdateRequest>
</s:Body>
</s:Envelope>

Response Error : 

IInvalid document schema. The following error was returned:  The element 'CustTable' in namespace 'schemas.microsoft.com/.../Customer' has invalid child element 'DirParty' in namespace 'schemas.microsoft.com/.../Customer'. List of possible elements expected: '_DocumentHash, AccountNum, AccountStatement, Affiliated_RU, AgencyLocationCode, BankAccount, BankCentralBankPurposeCode, BankCentralBankPurposeText, BankCustPaymIdTable, BirthCountyCode_IT, BirthDate_IT, BirthPlace_IT, Blocked, CashDisc, CashDiscBaseDays, CCMNum_BR, ClearingPeriod, CNAE_BR, CNPJCPFNum_BR, CommercialRegister, CommercialRegisterInsetNumber, CommercialRegisterSection, CommissionGroup, CompanyChainId, CompanyIdSiret, CompanyNAFCode, CompanyType_MX, ConsDay_JP, ContactPersonId, CreditCardAddressVerification, CreditCardAddressVerificationLevel, CreditCardAddressVerificationVoid, CreditCardCVC, CreditMax, CreditRating, Curp_MX, Currency, CustClassificationId, CustExcludeCollectionFee, CustExcludeInterestCharges, CustFinalUser_BR, CustGroup' in namespace 'schemas.microsoft.com/.../Customer'.

Thanks 

surajit kundu

  • Martin Dráb Profile Picture
    Martin Dráb 231,309 Most Valuable Professional on at
    RE: How to update a customer data using soap request ?

    The message is telling you two things:

    1. You forgot to include _DocumentHash. You'll get it by calling read operation.
    2. DirParty isn't a valid property of CustTable.

    You can see find some documentation in Updating Data With AIF. But the right flow is easier to see in a code snippet:

    var client = new CustomerServiceClient();
    
    // Read data from AX, including the hash
    var customers = client.read(callContext, entityKeyList);
    var custTable = customers.CustTable[0];
    
    // Modify table fields
    custTable.MyField = "123";
    
    // Send the update to AX
    client.update(callContext, entityKeyList, customers);

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,309 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans