Hi all,
I have a situation is adding 2 ranges to the QueryBuildDataSource to filter 2 difference columns with the same value, similar to the query string as below:
select tableName where column1 == "A" || columns == "A";
Could you show me how to implement that by Query, QueryBuildDataSoure object, please?
Thanks.
______________________________________
Dont think flowers is droped when the spring pass
0
Comments
The first question is: do you know how to build such query using QueryBuildDataSource etc. ?
If you do, so I can tell you some hint. You can use a string which be a queryExpression. You can put there a phrase of SQL and put it do your query as queryvalye. An example is in Address form in addQuerySmmQuotationTable method
If you still don't know how to do this, please let me know, I'll try to do some ready-to use example
I already finished that one. Thank you anyway...
Dont think flowers is droped when the spring pass
You can try this following code in a Job:-
SalesTable SalesTable;
Query Q;
QueryRun QR;
Str QueryString;
;
QueryString = '(CustAccount="4010") || (InvoiceAccount ="4010")';
Q = new Query();
//In addrange() you can add any fields from SalesTable
Q.addDataSource(Tablenum(SalesTable)).addRange(Fieldnum(SalesTable,CustAccount)).value(QueryString);
QR = new QueryRun(Q);
while(QR.next())
{
SalesTable = QR.getNo(1);
Print SalesTable.SalesId;
Pause;
}
Regards,
Chacko Thomas
Ciprian Dudau
Axapta Developer