Hi Experts,
Need some help.
I customize a form that can view the some records but i want to remove some of it.
How to translate this SQL Query to X++ Codes (Query).
select * from INVENTTRANSORIGIN where ((((REFERENCEID not like '%INF-SO%' and REFERENCEID not like '%CLA-SO%' ) or (DATAAREAID != 'wiz')) and ((REFERENCEID not like '%INF-PO%') or (DATAAREAID != 'inf'))) and ((REFERENCEID not like '%CLA-PO%') or (DATAAREAID != 'cla')))
public void init() { super(); qbdsTrans = this.query().dataSourceTable(tableNum(InventTransOrigin)); }
public void executeQuery() { qbrDataAreaId = qbdsTrans.addRange(fieldNum(InventTransOrigin, DataAreaId)); super(); }
Thanks & Regards,
*This post is locked for comments
qbds1 = this.query().dataSourceTable(tableNum(InventTransOrigin)); qbrTrans4 = qbds1.addRange(fieldNum(InventTransOrigin, DataAreaId)); qbrTrans4.value(strFmt('((((%1 NOT like *%2*) && %1 NOT like *%3*) || (%4 != %5)) && ((%1 NOT like *%6*) || (%4 != %7))) && ((%1 NOT like *%8*) || (%4 != %9)))', fieldNum(InventTransOrigin, ReferenceId), //%1 queryValue('INF-SO'), // %2 queryValue('CLA-SO'), // %3 fieldNum(InventTransOrigin, DataAreaId), //%4 queryValue('wiz'), // %5 queryValue('INF-PO'), //%6 queryValue('inf'), //%7 queryValue('CLA-PO'), //%8 queryValue('cla'))); //%8
If you have now !(a LIKE b) you should change it to (a NOT like b).
Hi Hossein,
same position or beside of like?
Hi Nikolaos,
same position or beside of like?
Change the operator to NOT (instead of !)
Regarding your error message "the '!' operator can only be used with the 'like' keyword."
Try using "NOT LIKE" instead of the ! mark.
Hi Hossein,
I did not try your code because i already do that using JOB but what i want to achieve now by using QueryBuildDatasource and Range in the Form and Datasource.
I already share above the code i tried and the error.
Can you please check my code above? it seems like i missing something...
Thanks in advance.
Hi Jhon,
Do you try my code?
Can you tell me about what you want?
Hi Hossein,
No, i did not yet fix
Hi,
Did you get this issue fixed in the meantime?
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