【问题标题】:Add elements into an array then find distinct,将元素添加到数组中,然后找到不同的,
【发布时间】:2019-08-17 12:46:51
【问题描述】:
On an Item Card Page, there is a selection of Item Category which has a Code field.

所以在销售报价中我选择了 2 个项目; 1) 前轮毂 2) 自行车 并且这两个项目在他们的项目卡页面中有一个项目类别代码集(分别说椅子、桌子)。我将在销售报价报告中打印椅子/办公桌。

我正在接近这一点,首先找到行项目的项目类别代码,然后将它们放入一个数组中,然后我将比较并移动不同的项目(查找不同的原因是如果 2 个项目具有相同的项目类别代码,我必须只打印一次该代码,因此如果 3 个行项目有 Desk、Desk、Chair,我将在报表上打印 Desk/Chair) 到另一个数组中,然后将带有“/”的值连接到一个文本变量中。 这是我到目前为止所做的,但在将正确的值放入我的数组时遇到了困难。

On the OnAfterGetRecord Trigger of my Sales Quote Report
I have written;
ItemCateTableRec.Reset();
ItemCateTableRec.SetFilter(Code, "Sales Line"."Item Category Code");
IF ItemCateTableRec.FindSet then begin
repeat
myArray [ i ] := ItemCateTableRec.Code;
i := i + 1;
until ItemCateTableRec.Next = 0;
end;

在打印 myArray[1] 和 [2] 时,我没有为我的 Item FrontHub 和 Desk 为我的 Item Bicycle 获得正确的 Item Category Code Chair。我得到不正确的值。 非常感谢您的任何指导。

【问题讨论】:

    标签: microsoft-dynamics navision microsoft-dynamics-nav dynamics-business-central


    【解决方案1】:

    您要查找的不是数组。是temporary table

    您需要将项目类别的表变量定义为临时的,然后就可以了

    If not TempCategoryCode.Insert then ; //do nothing 
    

    这将为您提供一个包含唯一代码的表格。

    【讨论】:

      猜你喜欢
      • 2015-06-28
      • 2016-03-02
      • 1970-01-01
      • 2012-06-03
      • 1970-01-01
      • 1970-01-01
      • 2019-09-09
      • 1970-01-01
      • 2015-05-11
      相关资源
      最近更新 更多