Joy
Joy

Reputation: 7028

Dynamics AX 2009 : can't save new Customer via webservice using AxdCustomer Class

 CustomerService CustService = new CustomerService();

        try
        {               
            CustService.Credentials = new NetworkCredential("xxx", "xxx", "xxx");
            AxdCustomer customer = new AxdCustomer();
            AxdEntity_CustTable[] table = new AxdEntity_CustTable[1];
            AxdEntity_CustTable test = new AxdEntity_CustTable();

            test.AccountNum = TextBox1.Text;
            test.Name = TextBox1.Text;
            test.CustGroup = DropDownList1.SelectedItem.Value;
            table[0] = test;

            customer.CustTable = table;
            CustService.create(customer);
        }      

        catch (Exception ex)
        {
            err.Visible = true;
            lblerr.Text = ex.Message;
        }

I am new to Dynamics AX. I'm trying to create a customer which is actually created by consuming a webservice from the web . the above code snippet is the code for that, but it's giving an exception as :

Request Failed. See the Exception Log for details.

I'm not even getting the actual reason why it's not getting created. How to create a customer in dynamics AX 2009 sp1?

Note: CustService is the CustomerService object for the class in CustomerSvc namespace (it is the webservice reference to the CustomerService webservice in Dynamics).

Upvotes: 1

Views: 996

Answers (1)

Looneystar
Looneystar

Reputation: 161

Have a look at the event log in the server where there webservice and the AOS is hosted on. You may get half a clue from there.

Also have a look at the exception log in AX which you can get from Basic -> Periodic -> Application Integration framework -> Exceptions

Once you get the error details then you may figure out the problem otherwise post them here and I an have a further look at what the problem might be.

Upvotes: 1

Related Questions