You can apply customized expressions as range on a document record.
Document
You can apply the expression as range to the source document if is a D365 F&SCM document. To do so, add a range of type Custom to the desired document record. Usually, this is the root record. In the Range field, enter the expression..
Example
You need a range that limits the selection of records to records with a date later than today or no date defined.
In this case, use this expression: StrFmt(‘(tableName.todate > %1) || (tableName.todate == %2)’, today(), 0)
Note
Do not use this expression: StrFmt(‘(tableName.todate > %1) || (tableName.todate == %2)’, today(), dateNull())
Other
Examples of other custom expressions that you can apply are:
strFmt('(PurchPool.BisQualifier == \"%1\") || (PurchPool.BisQualifier == \"\")', curext())
strfmt('%1,\"\"', curext())
strFmt('> %1', SysQuery::value(DateTimeUtil::utcNow()))
strFmt('((> %1 || \"\"))', SysQuery::value(DateTimeUtil::utcNow()))
strFmt(' %1 | %2',BisCompanyParameters::find(curExt()).recid,BisCompanyParameters::find(curExt()).SourceCompanyid)
SysQuery::range(DateTimeUtil::minValue(),DateTimeUtil::utcNow())
SysQuery::range(DateTimeUtil::utcNow(), DateTimeUtil::maxValue())
curExt()
BisCompanyParameters::find(curExt()).LedgerChartOfAccounts
InventDim::inventDimIdBlank()
tableNum(EcoResCategory)
SysQueryRangeutil::LessThanDate(0)
SysQueryRangeUtil::greaterThanDate(0)
SysQueryRangeutil::LessThanDate(-3)
SysQueryRangeUtil::greaterThanDate(-3)
queryValue(dateNull())
sysQueryRangeUtil::lessThanUtcNow()
SysQueryRangeUtil::greaterThanUtcNow()
SysQuery::value(DateTimeUtil::MinValue())
BisCompanyParameters::find(curExt()).SourceCompanyid
BisCompanyParameters::find(curExt()).LedgerChartOfAccounts
BisCompanyParameters::find(curExt()).SourceCompanyid
BisCompanyParameters::find(curExt()).LedgerChartOfAccounts