Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Aif : Update sales order error in AxdSalesOrder _SalesOrderList = _Client.read(_callContext, entityKeys);

Posted on by 570

Hello ..

i need to update custAccount in specified sales order so

public void SalesOrderHeaderM()
{

KeyField keyField = new KeyField() { Field = "SalesId", Value = "EGC-231739" };
EntityKey entityKey = new EntityKey();
entityKey.KeyData = new KeyField[1] { keyField };
EntityKey[] entityKeys = new EntityKey[1] { entityKey };
SalesOrderServiceClient _Client;
using (_Client = new SalesOrderServiceClient())
{
CallContext _callContext = new CallContext();
_callContext.Company = "egc";
AxdSalesOrder _SalesOrderList = _Client.read(_callContext, entityKeys);
AxdEntity_SalesTable _SalesOrderTable = _SalesOrderList.SalesTable.First();
_SalesOrderTable.CustAccount = "C-060414";

_SalesOrderTable.action = AxdEnum_AxdEntityAction.update;
_SalesOrderTable.actionSpecified = true;

_Client.update(_callContext, entityKeys, _SalesOrderList);

}

but when app start i got an error
0383.update.png

all fields enabled in data policies ..

also ,can and one tell me what  _SalesOrderList.SalesTable.First(); means ?

any help ..

*This post is locked for comments

  • Verified answer
    Ismail Mohamed Profile Picture
    Ismail Mohamed 570 on at
    RE: Aif : Update sales order error in AxdSalesOrder _SalesOrderList = _Client.read(_callContext, entityKeys);

    resolved by next

                   _SalesOrderTable.PurchOrderFormNum = "645645";

                   _SalesOrderTable.SalesLine = null;

                   _SalesOrderTable.TableDlvAddr = null;

    Thanks

  • Ismail Mohamed Profile Picture
    Ismail Mohamed 570 on at
    RE: Aif : Update sales order error in AxdSalesOrder _SalesOrderList = _Client.read(_callContext, entityKeys);

    now i can say after test the code with other AOS , this message is not related to read() 

    --

    Here is details of the exception in Visual Studio

    Exception:Thrown: "Could not load file or assembly 'AXSalesIntegration.XmlSerializers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified." (System.IO.FileNotFoundException)
    A System.IO.FileNotFoundException was thrown: "Could not load file or assembly 'AXSalesIntegration.XmlSerializers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
    Time: 2/10/2019 12:40:34 PM
    Thread:<No Name>[14788]
    
    
    Exception:Caught: "Could not load file or assembly 'AXSalesIntegration.XmlSerializers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified." (System.IO.FileNotFoundException)
    A System.IO.FileNotFoundException was caught: "Could not load file or assembly 'AXSalesIntegration.XmlSerializers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
    Time: 2/10/2019 12:40:34 PM
    Thread:<No Name>[14788]
    
    
    Exception:Thrown: "Could not load file or assembly 'AXSalesIntegration.XmlSerializers' or one of its dependencies. The system cannot find the file specified." (System.IO.FileNotFoundException)
    A System.IO.FileNotFoundException was thrown: "Could not load file or assembly 'AXSalesIntegration.XmlSerializers' or one of its dependencies. The system cannot find the file specified."
    Time: 2/10/2019 12:40:34 PM
    Thread:<No Name>[14788]
    
    
    
    Exception:Caught: "Could not load file or assembly 'AXSalesIntegration.XmlSerializers' or one of its dependencies. The system cannot find the file specified." (System.IO.FileNotFoundException)
    A System.IO.FileNotFoundException was caught: "Could not load file or assembly 'AXSalesIntegration.XmlSerializers' or one of its dependencies. The system cannot find the file specified."
    Time: 2/10/2019 12:40:34 PM
    Thread:<No Name>[14788]
    
    
    
    Exception:Thrown: "Request Failed. See the Exception Log for details." (System.ServiceModel.FaultException`1)
    A System.ServiceModel.FaultException`1 was thrown: "Request Failed. See the Exception Log for details."
    Time: 2/10/2019 12:40:37 PM
    Thread:<No Name>[14788]
    
    
    Exception:Caught: "Request Failed. See the Exception Log for details." (System.ServiceModel.FaultException`1)
    A System.ServiceModel.FaultException`1 was caught: "Request Failed. See the Exception Log for details."
    Time: 2/10/2019 12:40:37 PM
    Thread:<No Name>[14788]
    
    
    
    Exception:Thrown: "Request Failed. See the Exception Log for details." (System.ServiceModel.FaultException`1)
    A System.ServiceModel.FaultException`1 was thrown: "Request Failed. See the Exception Log for details."
    Time: 2/10/2019 12:40:37 PM
    Thread:<No Name>[14788]
    
    
    Debugger:Stopped at Exception: HandleReturnMessage
    An exception was caught by the debugger, and user settings indicate that a break should occur.
    Time: 2/10/2019 12:40:37 PM
    Thread:<No Name>[14788]
    
    
    
    Debugger:Exception Intercepted: SalesOrderHeaderM, Form1.cs line 56
    An exception was intercepted and the call stack unwound to the point before the call from user code where the exception occurred.  "Unwind the call stack on unhandled exceptions" is selected in the debugger options.
    Time: 2/10/2019 12:40:38 PM
    Thread:<No Name>[14788]
    


    Thanks

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Aif : Update sales order error in AxdSalesOrder _SalesOrderList = _Client.read(_callContext, entityKeys);

    Are you sure that these messages are related to your problem with read() mentioned above?

    By the way, do you know what you can also debug document services? (Although I would first look at details of the exception in Visual Studio.)

  • Ismail Mohamed Profile Picture
    Ismail Mohamed 570 on at
    RE: Aif : Update sales order error in AxdSalesOrder _SalesOrderList = _Client.read(_callContext, entityKeys);

    when i tested it on other AOS i got an exception

    4428.update3.png

    first exception when sales order is empty liens 

    second and third when sales orders has liens

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Aif : Update sales order error in AxdSalesOrder _SalesOrderList = _Client.read(_callContext, entityKeys);

    Just knowing that there is some error isn't good enough - look at what actually failed.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans