Is there any difference between fieldstr and fieldnum?
QueryBuildDataSource qbds;
qbds = this.query().dataSourceTable(tableNum(Test));
qbds.name('Test');
qbds.addRange(fieldNum(Test, CustGroupId)).value(strFmt('((%1.%2 == "20") || (%1.%3 == "30"))', qbds.name(),
fieldStr(Test, CustGroupId),
fieldStr(Test, CustGroupId)));
Code doesnt work if i replace fieldnum with fieldstr.
*This post is locked for comments
Thank you Nikolaos.
You are using an expression in your query range. There you need to use the field name. Normal simple range values don't contain field ids or names but if you want to use expressions, you need to use table and field names.
And fieldstr is required to pass value to range?
FieldNum returns the field id.
FieldStr returns the field name.
QueryBuildDataSource.addRange method wants field id as a parameter.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156