【问题标题】:Dynamics AX 2012 parsing Int32 to table field integerDynamics AX 2012 将 Int32 解析为表字段整数
【发布时间】:2014-05-21 14:55:23
【问题描述】:

我正在使用引用的 DLL 从 Web 服务中检索数据。数据检索良好。我将一些字段复制到 inMemory 表中。这很好用,除非是 Int32 类型。

如您所见,Id 字段的类型为 Int32。表字段 (ProductId) 是一个整数。 这编译没有错误,但是当我运行代码时,我得到以下错误:

Error executing code: Wrong argument types in variable assignment.

此错误指向带有 productId 的行。删除它使代码工作。我也尝试将 Id 设为字符串,然后将 str2int() 设为字段,但这也不起作用。

有什么想法吗?

谢谢, 史蒂夫

【问题讨论】:

    标签: x++ dynamics-ax-2012-r2


    【解决方案1】:

    尝试在两种类型之间显式编组:

    System.Int32 netInt;
    int          xppInt;
    ;
    
    // -- Other code
    // ...
    netInt = product.get_Id();
    xppInt = netInt;
    tempData.ProductId = xppInt;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多