D365F&O - X++ - Filter the form records based on the caller form in excuteQuery method
1- Open the form designer.
2- Go to datasource, expand and right click on methods.
3- select override executeQuery method.
public void executeQuery()
{
// Get the calling form record
OrderRefundTable orderRefund = element.args().record();
QueryBuildDataSource queryBuildDataSource;
queryBuildDataSource = this.query().dataSourceTable(tablenum(OrderRefundTable));
queryBuildDataSource.clearRanges();
// Add range to your current form datasource
queryBuildDataSource.addRange(fieldnum(OrderRefundTable, SalesId)).value
(queryValue(orderRefund.SalesId));
super();
}
Comments
Post a Comment