# Document Service: Error in validating field

**URL:** <https://www.dynamicsuser.net/t/document-service-error-in-validating-field/62696>\
**Category:** Developer Forum\
**Created:** [February 14, 2017, 5:01am UTC](https://www.dynamicsuser.net/t/document-service-error-in-validating-field/62696 "2017-02-14T05:01:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![billgates](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@billgates](https://www.dynamicsuser.net/u/billgates)\
**Post date:** [February 14, 2017, 5:01am UTC](https://www.dynamicsuser.net/t/document-service-error-in-validating-field/62696/1 "2017-02-14T05:01:43Z")

</div>

Hi ,

I Create the Document Service and i consume the Service in to the visualStudio … When i run the Code in Visual Stdio it shows the Error… in Console Creation has been Cancelled …

In exception Blog it shows that ERROR:Error in validating Field ,Creation is cancelled .My visual Studio Code is attached Below …

salestable.SalesId = “SO-101367”;  
salestable.CustAccount = “1101”;  
salestable.InvoiceAccount = “1101”;  
salestable.CurrencyCode = “USD”;  
salestable.CustGroup = “20”;  
salestable.LanguageId = “en-us”;  
salestable.ShippingDateRequested = Convert.ToDateTime(“02/14/2017 12:00 AM”);  
salestable.ShipCarrierDlvType = SO.AxdEnum\_ShipCarrierDlvType.Ground;  
salestable.ShipCarrierDlvTypeSpecified = true;  
salestable.Payment = “N001”;  
salestable.PurchOrderFormNum = “POhgfkafk”;  
salestable.DlvMode = “10”;  
salestable.DeliveryDate = Convert.ToDateTime(“2/14/2017”);  
SalesOrderSO.SO.AxdEntity\_SalesLine salesline = new SO.AxdEntity\_SalesLine();//SalesLine  
salesline.CurrencyCode = “USD”;  
salesline.CustAccount = “1101”;  
salesline.ShippingDateRequested = Convert.ToDateTime(“02/14/2017 12:00 AM”);  
salesline.ItemId = “1000”;  
salesline.SalesQty = 1;  
salesline.SalesUnit = “ea”;  
salesline.SalesId = “SO-101365”;  
salesline.SalesQtySpecified = true;  
salesline.CustGroup = “20”;

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [February 14, 2017, 7:08am UTC](https://www.dynamicsuser.net/t/document-service-error-in-validating-field/62696/2 "2017-02-14T07:08:55Z")

</div>

It says that validation of a field failed. Why don’t you use the debugger to see what’s going on? The debugger will tell you more than we can.  
I can’t even review your code, because it’s just a snippet and not the whole thing.
