如何在表单部件的列表页面中显示所有选定记录的总数?
答案 0 :(得分:0)
你的问题是非常开放的,但这里有一些我编写的示例代码来循环选定的记录,这样你就可以"做"用它的东西。我只选择SalesLine
作为您可能选择的示例表缓冲区。
int i;
Qty totalQty;
// Make this your data source
FormDataSource fds;
// This is an array of what records are marked
Array markedRecords = fds.recordsMarked();
// This is the table buffer that you can look at
// when looping over the selected records
SalesLine salesLine;
// This loops over the selected records so you can "do" something
i = 1;
while (i <= markedRecords.lastIndex())
{
salesLine = fds.cursor(markedRecords.value(i));
totalQty += salesLine.SalesQty;
i++;
}