Hi All,
I am getting following error while creating sales order through SalesSalesOrderService.create service
Document Sales Order Could not be created.### Error Reading Value of Type Date from XML.
Please give me quick reply.
Regards,
Harshal
I am getting following error while creating sales order through SalesSalesOrderService.create service
Please give me quick reply.
Regards,
Harshal
It would help if you gave us more information about your scenario.
The error says that a date value can’t be read - maybe you have some date(s) in incorrect format.
Thanks for your quick reply.
I am getting error for the line salesTable.DeliveryDate = Convert.ToDateTime(“2/14/2010”); in C#.
while consuming SalesSalesOrder.create service of AX 2012.
Okay, now the problem is obvious - the C# code will throw FormatException with a clear message: “String was not recognized as a valid DateTime”. That’s because the string (2/14/2010) is not in the right format for the current culture. For example, it’s valid for en-US but not for en-GB.
Either change the text (e.g. to 14/02/2010) or your culture (e.g. System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(“en-US”)).
I am still continuing with the same error
Error Reading Value of Type Date from XML under
System Admin->Periodic->AIF->Exception
I am Still Continuing with the same error
Error Reading Value of Type date from XML under
System Admin->Periodic->AIF->Exception
I am also facing the same problem.
When I am creating sales order using SalesSalesOrder service from Visual Studio C#.NET, its showing following exception :
"Document Sales order could not be created. Error details: Stack trace: Invalid attempt to call RunBase.promptOnClient running in CIL on the client."
Kumar, it’s not the same problem. You’re trying to execute client-bound code (RunBase.promptOnClient()), which isn’t possible, because the web service runs on AOS without any AX client.
Hi Martin,
I have a VMWare with AX 2012 installed in one box with client and server. should I uninstall client and run. Then reinstall to check it?.
No, the problem is in your code - it tries to open a dialog (promptOnClient()), which doesn’t make sense if it runs in a non-interactive session on AOS.
Hi Martin,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SalesOrder.SalesOrderService;
namespace SalesOrder
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
SalesOrderServiceClient client = new SalesOrderServiceClient();
AxdSalesOrder salesOrder = new AxdSalesOrder();
AxdEntity_SalesTable salestable = new AxdEntity_SalesTable();
AxdEntity_SalesLine salesLine = new AxdEntity_SalesLine();
CallContext callContext = new CallContext();
EntityKey[] keys;
EntityKey key;
KeyField fld;
CallContext context = new CallContext();
context.Company = “ceu”;
salestable.CustAccount = “1101”;
salestable.PurchOrderFormNum = “”;
salestable.ReceiptDateRequested = Convert.ToDateTime(“2/1/2012”);
//new DateTime(2013, 11, 15);
salesLine.ItemId = “1000”;
salesLine.SalesQty = 1;
salesLine.SalesUnit = “ea”;
salestable.SalesLine = new AxdEntity_SalesLine[] { salesLine };
salesOrder.SalesTable = new AxdEntity_SalesTable[] { salestable };
salestable.PurchOrderFormNum = “PO15”;
callContext.Company = “ceu”;
callContext.Language = “en-us”;
keys = client.create(callContext, salesOrder);
key = keys[0];
fld = key.KeyData[0];
MessageBox.Show(“Sales Order” + fld + “Created success fully”);
}
catch (Exception ex)
{
string msg = ex.Message;
}
}
}
}
Kumar, RunBase class is defined in AX, therefore you have to deal with the code in AX that’s calling it. If you don’t know where it’s called, use debugger.