How to: Add Filter Controls to a Simple List Form [AX 2012 R3]
Step 1:Create a form filter
Step: 2
int selectionChange()
{
int ret;
ret = super();
QMPurchTable_ds.executeQuery();
return ret;
}
Step: 4
Write the below on FORM Datasource.
// If you are filtering used Enum Values. Please find the code below.
public void executeQuery()
{
AXStatus qmStatusExe; // EnumValue
// converting the string value to enum
qmStatusExe = str2enum(AXStatus,QMStatus.valueStr()); // values from the filter.
qr = SysQuery::findOrCreateRange(QMPurchTable_q.datasourceTable(tableNum(QMPurchTable)),fieldNum(QMPurchTable,QMStatus));
if (qmStatusExe == AXStatus::Open)
{
qr.value(queryValue(AXStatus::Open));
}
else if (qmStatusExe == AXStatus::Closed)
{
qr.value(queryValue(AXStatus::Closed));
}
else
{
qr.value(SysQuery::valueUnlimited());
}
qr.status(RangeStatus::Locked);
super();
}
No comments:
Post a Comment