Hi
@Martin Dráb,
Ok i got your point now. I think what you mean is this:
public static void main(Args _args)
{
Controller1 controller = Controller1::construct();
Contract1 contract = controller.getDataContractObject() as Contract1;
List idsList = new List(Types::String);
FormDataSource table1_ds = FormDataUtil::getFormDataSource(_args.record());
Query query = table1_ds.query();
QueryRun queryRun = new QueryRun(query);
while(queryRun.next())
{
Table1 table1 = queryRun.get(tablenum(Table1)) as Table1 ;
idsList.addEnd(table1.Id);
}
contract.parmIds(idsList);
controller.startOperation();
}
but now regarding which solution is better:
In solution1 (Query) , if we use contract.SetQuery(), then regardless of current records in the form, even if we do manual filtration on any column, it will always take what the form query returned, and update records accordingly.
A disadvantage i can see, is that if before i run the batch, a new record got created by another user that matches the current form query ranges, but i don't see it because i need to do small refresh on the form, it will still be updated even though i didn't see it in my current form.
Correct? This would also happen if we use the 2nd Solution (contract.ParmList()) as i loop through query form and add ranges to the Ids,
right?
can this be avoided?
but a disadvantage in solution2 (contract.ParmList()), is that if the Ids i added to the list, suddenly didn't meet the queryRange anymore, then it will make me update un-needed records, which is wrong? And to fix this, maybe i will need to add all the conditions in the query range again in the service class, but if microsoft added a conditon/range later, it means my service class won't handle this condition
sth about solution 3( multi selection helper), which might appears as an advantage, is that after the form opens, if someone add extra manual filtration, by filtering on any column, then this will affect what I update, i mean if the form data source query returned 3 records, then i fitlered on the form on one record, then only one record will be updated
how to decide which one is better? what normal forms do?