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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AIF: Update sales order error: Entity update mode must be specified

(0) ShareShare
ReportReport
Posted on by 1,244

Hi all,

Greetings!

I could use some help here.

I am trying to update a sales order using its document service.

When I try the code mentioned here (or my own code for that matter) I get "Entity update mode must be specified".

I am not sure where to mention the updateMode.

            SalesOrderDocuService.KeyField keyField = new SalesOrderDocuService.KeyField() { Field = "SalesId", Value = _salesId };

            SalesOrderDocuService.EntityKey entityKey = new SalesOrderDocuService.EntityKey();

            entityKey.KeyData = new SalesOrderDocuService.KeyField[1] { keyField };

            SalesOrderDocuService.EntityKey[] entityKeys = new SalesOrderDocuService.EntityKey[1] { entityKey };

            SalesOrderDocuService.SCA_AxdSalesOrderServiceClient _Client;

            using (_Client = new SalesOrderDocuService.SCA_AxdSalesOrderServiceClient())
            {

                SalesOrderDocuService.CallContext _callContext = new SalesOrderDocuService.CallContext();

                _callContext.Company = axCompanyName;

                SalesOrderDocuService.AxdSCA_AxdSalesOrder _SalesOrderList = _Client.read(_callContext, entityKeys);

                SalesOrderDocuService.AxdEntity_SalesTable _SalesOrderTable = _SalesOrderList.SalesTable.First();

                SalesOrderDocuService.AxdEntity_SalesLine SalesLine = _SalesOrderTable.SalesLine.First();

                decimal newQty = 3;

                SalesLine.SalesQty = newQty;

                _Client.update(_callContext, entityKeys, _SalesOrderList);

            }


Regards,

Abhinay

*This post is locked for comments

I have the same question (0)
  • Abhinay Tharwal Profile Picture
    1,244 on at

    Hi,

    I think an update will not be possible for a document service with views in it.

    I will try that with a custom service.

    Regards,

    Abhinay

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans