extend data entity to remove OOB range in Microsoft Dynamics 365 Finance and Operations apps'
Option1
Add range in this event : onInitializedEntityDataSource as follows:
QueryBuildDataSource qbd;
FormDatasource fb = _sender.dataSource();
qbd = fb.query().dataSourceTable(tableNum(SalesTable));
qbd.findRange(fieldNum(SalesTable, SalesType)).value(SysQuery::value(SalesType::ReturnItem));
initializeEntityDataSource() (or onInitializedEntityDataSource) is not called by fetching records of a data entity (export DMF/GET OData). Only the postLoad() method is called for an data entity export.
Option2 - easiest one
Create new data entity (copy of), keep same target table and remove filter.
*This post is locked for comments