Skip to Content
0
Former Member
Nov 18, 2008 at 09:39 AM

Date deviates from permissible range

22 Views

hi all,

I need help for sales order entry.

When I enter sales order entry then I get the error.

Error Is:

Date deviates from permissible range

My Code is :

Document doc = new Document();

_OrdSer = new OrdersService();

doc.Address = "ab";

doc.AgentCode = "ab";

doc.CardCode = "pmgweb2";

doc.CardName = "PMG Web Store Test Cust";

doc.DocDate = DateTime.Parse("2008-02-11");

doc.DocDueDate = DateTime.Now.Date;

//doc.TaxDate = DateTime.Parse("2008-02-11");

doc.DocType = DocumentDocType.dDocument_Service;

doc.DocumentStatus = DocumentDocumentStatus.bost_Open;

doc.BaseAmount = 1000;

doc.DocCurrency = "USD";

doc.DocNum = 1;

doc.HandWritten = DocumentHandWritten.tYES;

MsgHeader msgHeader = new MsgHeader();

msgHeader.SessionID = _SID;

msgHeader.ServiceName = MsgHeaderServiceName.OrdersService;

msgHeader.ServiceNameSpecified = true;

_OrdSer.MsgHeaderValue = msgHeader;

DocumentDocumentLine[] d = new DocumentDocumentLine[1];

d[0] = new DocumentDocumentLine();

d[0].ItemCode = "9786306243753";

d[0].ItemDescription = "abc";

d[0].UnitPrice = 10;

d[0].Quantity = 4;

d[0].SerialNum = "1";

d[0].LineNum = 0;

d[0].BaseLine = 1;

d[0].ItemDetails = "abdc";

d[0].TaxCode = "0";

DocumentDocumentLineSerialNumber[] dl = new DocumentDocumentLineSerialNumber[1];

dl[0] = new DocumentDocumentLineSerialNumber();

dl[0].SystemSerialNumber = 1;

dl[0].BaseLineNumber = 1;

dl[0].BatchID = "01";

d[0].SerialNumbers = dl;

DocumentDocumentLineBatchNumber[] db = new DocumentDocumentLineBatchNumber[1];

db[0] = new DocumentDocumentLineBatchNumber();

db[0].BatchNumber = "01";

db[0].Quantity = 4;

d[0].BatchNumbers = db;

doc.DocumentLines = d;

_OrdSer.Add(doc);

Please Help Me.

thanks.