0

I have a simple custom table in AX, for which i need to create a Web service so that data could be populated by an external system. I created a Document service with all the Axd* and Ax* objects involved. Next i wrote a simple console application to try populating some dummy data. Interesting thing is i can only get string data type columns populated. Int, Real, Date, Enums etc are not coming through.

In the code below, i am only getting StoreItemId and Barcode columns, as both are strings. Cost is real, ErrorType is Enum, DocketDate is date and none of them get any values. I have discussed this issue with many colleagues and none is aware whats happening. Does anyone know or could point me in some new direction? Thanks a lot.

PS - I have limited experience with AIF and if i am missing something fundamental, please excuse and do let me know. Thanks.

AxdEntity_MMSStagingSalesImport stagingSalesImport = new AxdEntity_MMSStagingSalesImport();
stagingSalesImport.StoreItemId = "9999";
stagingSalesImport.Barcode = "1234546";
stagingSalesImport.Cost = 22;
stagingSalesImport.ErrorType = AxdEnum_MMSImportErrorType.Posting;
stagingSalesImport.DocketDate = new DateTime(2014, 4, 4);
stagingSalesImport.IsDuplicate = AxdEnum_NoYes.Yes;
4

2 回答 2

1

对于某些类型,您必须指定已设置值,以便 AX 知道空值和已设置值之间的区别:

stagingSalesImport.Cost = 22;
stagingSalesImport.CostSpecified = true;
stagingSalesImport.ErrorType = AxdEnum_MMSImportErrorType.Posting;
stagingSalesImport.ErrorTypeSpecified = AxdEnum_MMSImportErrorType.Posting;
于 2014-04-07T14:00:10.163 回答
0

感谢您回复 Klaas,我也喜欢您的博客。

应该早点回复,但我解决了这个问题。我没有尝试 Klaas 的选项,但我查看了入站端口的数据策略,发现没有启用任何列。我启用了我需要的那些,并使它们中的大多数也成为必需的。你猜怎么着,这行得通。我期望这些列应该默认启用。

于 2014-04-12T04:57:18.727 回答