X++获取当前选择行记录
1、“TableName = TableName_DS.cursor()”//TableName_DS是数据源名称
void clicked(){
ProjTable _projTable;
super();
//获取当前记录
_projTable = ProjTable_DS.cursor();
if( _projTable.TEK_MosOpportunityID || _projTable.TEK_ProjMosUrl){
if(_projTable.TEK_ProjMosUrl){
infolog. urllookup(strfmt("%1", _projTable.TEK_ProjMosUrl));
}
else{
infolog. urllookup(strfmt("https://XXX/lightning/n/My_Sales_MOS?AxSFD__id="+ "%1", _projTable.TEK_MosOpportunityID));
}
}else{
error("未知网址!");
}
}2、
void clicked()
{
MultiSelectionHelper selectionHelper = MultiSelectionHelper::construct();//Create instance of class
Set selectedRecords = new Set(Types::Record);//Declare a set of type record
MyLinesTable tableLines; //Your table buffer
super();
selectionHelper.parmDataSource(MyLinesTable_DS); //Set the datasource
tableLines = selectionHelper.getFirst(); //assign to table buffer the reference to selected record(s)
if (tableLines.RecId)
{
while (tableLines)
{
selectedRecords.add(tableLines);
info(strFmt('Selected record.. %1',tableLines.myField));//Display selected record
tableLines = selectionHelper.getNext();
}
}


留言评论
暂无留言