Axapta Ax2012-获取网格中选定行中accountNum的值
在表单Axapta Ax2012-获取网格中选定行中accountNum的值,axapta,microsoft-dynamics,x++,ax,Axapta,Microsoft Dynamics,X++,Ax,在表单cutslistepage中,我想获取网格中所选行的accountNum值,并将其传递给另一个表单 我尝试过: int64 recordsCount; recordsCount = CustTable_ds.recordsMarked().lastIndex(); // CustTable = CustTable_ds.getFirst(1); 如果要检索custable记录,请检查custableListPageInteraction类。 在selectionCha
cutslistepage
中,我想获取网格中所选行的accountNum值,并将其传递给另一个表单
我尝试过:
int64 recordsCount;
recordsCount = CustTable_ds.recordsMarked().lastIndex();
// CustTable = CustTable_ds.getFirst(1);
如果要检索
custable
记录,请检查custableListPageInteraction
类。
在selectionChanged
方法中,它有以下代码:
custTable = CustTable::findRecId(this.listPage().activeRecord(queryDataSourceStr(CustTableListPage, CustTable)).RecId);
这是检索记录的方式。但是由于已经完成了,您可以简单地使用类声明中已经声明的custTable
变量
旁注:如果您有从列表页面打开的其他表单,则应根据表单的数据源之间的关系自动对其进行筛选。所以你可能在为一个你不应该有的问题寻找解决方案。例如,创建一个表单,该表单的数据源与其上的
custable
表相关,并且该表单应在列表页面和表单之间创建一个dynaink,以过滤该客户的记录 如果只选择了一条记录,则可以执行以下操作:
info(CustTable_ds.accountNum);
否则,如果选择了多条记录,则需要执行以下操作:
custTable = CustTable_ds.getFirst(true);
while (custTable)
{
info(custTable.accountNum);
custTable = CustTable_ds.getNext();
}
我尝试了这个方法,但没有成功,他给出了相同的值信息(int642str(custable.getFieldValue(“AccountNum”,1));为什么要使用
getFieldValue
方法?只需使用info(custable.AccountNum)代码>。另外,不要将AccountNum
字段从int64强制转换为字符串,因为它是字符串,而不是int64。