有没有办法处理您在 X++ 上标记为 table 的记录?

Is there a way to work with records that you marked in table on X++?

我想使用 table 已 select 编辑(标记)的记录,示例 - 我在 table 中有 10 条记录,我标记了其中的 5 条。预期 - 当我处理 selected 记录时,它应该只查看那 5 条记录,而不是全部 10 条记录。

到目前为止我有这段代码select所有记录:

while select Table
                where table.JournalId == table.JournalId

有什么办法可以让select只标记记录,而不是全部? select写在class中。我需要将那些标记的记录放入 class 中,其中写入 select...

您需要将 formdatasource 对象传递到正在选择记录的 class,然后使用 MultiSelectionHelper 循环遍历 formdatasource 上的选定记录。

在下面的示例中,对象 salesTableFormDataSource 需要从表单传递到您正在使用的 class。显然用你的 datasource/table 需要的任何东西替换它。

MultiSelectionHelper selection = MultiSelectionHelper::construct();
selection.parmDatasource(salesTableFormDataSource);
SalesTable salesTable = selection.getFirst();

while (salesTable)
{
    //do something with your table buffer.
    salesTable = selection.getNext();
}