Hello Martin, I appreciate your time and assistance.
Please allow me to elaborate on my business requirements.
After the user tries to choose certain records from a query, I have to hide those records, and I will show you some screenshots.
I get your point about the job and why I need to place the code before the query execution.
(I already changed that.)
when i ran your job, i got this
- RecId 5637176840, SalesId SO-000797, ProFormaInvoice , ParmJobStatus Executed
- RecId 5637176838, SalesId SO-000796, ProFormaInvoice , ParmJobStatus Executed
- RecId 5637176157, SalesId SO-000795, ProFormaInvoice , ParmJobStatus Executed
-
and 500 more. this is not what i want to keep in the datasource.
I made this job to display the records that I wish to hide or even delete if it's easier.
Query query = new Query();
QueryBuildDataSource qbds = query.addDataSource(tableNum(SalesParmTable));
qbds.addRange(fieldNum(SalesParmTable, xxProFormaInvoice)).value(SysQuery::valueNotEmptyString());
qbds.addRange(fieldNum(SalesParmTable, ParmJobStatus)).value(SysQuery::value(ParmJobStatus::Waiting));
QueryRun qr = new QueryRun(query);
while (qr.next())
{
SalesParmTable parmTable = qr.get(tableNum(SalesParmTable));
info(strFmt("RecId %1, SalesId %2, ProFormaInvoice %3, ParmJobStatus %4", parmTable.RecId, parmTable.SalesId, parmTable.xxProFormaInvoice, parmTable.ParmJobStatus));
}
and this is the result
RecId 5637182079, SalesId SO-000783, ProFormaInvoice xx-00004, ParmJobStatus Waiting
RecId 5637180581, SalesId SO-000783, ProFormaInvoice xx-00003, ParmJobStatus Waiting
RecId 5637179083, SalesId SO-000783, ProFormaInvoice xx-00002, ParmJobStatus Waiting
RecId 5637191844, SalesId SO-000770, ProFormaInvoice xx-00011, ParmJobStatus Waiting
RecId 5637190367, SalesId SO-000770, ProFormaInvoice xx-00007, ParmJobStatus Waiting
i need to hide (or delete from datasource) this records
i need to hide the records that have "ProFormaInvoice not empty and ParmJobStatus is waiting" at the same time on the same record
when the user select a query from here and the result show one those records.
For example, I have to hide these record.
Once again, Martin, I appreciate your time and assistance. I hope my response did not cause further confusion.