Henrik Berg Andersen
2010-01-20 18:13:02 UTC
Hi folks.
I am trying to do this:
form = new Form(formstr(PurchTable));
inventDim_fbds = form.datasource(3);
new_fbds = form.addDataSource(tablestr(InventLocation));
new_fbds.table(tablenum(InventLocation));
new_fbds.joinsource(inventDim_fbds.id());
args = new Args(form);
args.object(form);
formRun = classFactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.detach();
If I try run time in a job to add a datasource to a simple form like for
instance the form InventDim then the above code will work just fine (I did
not include variable declarations in the text). However, as soon as I try and
do it on a form, in which controls are autodeclared then it crashes with a
stack trace saying that the control does not have this or that method or is
not initialized.
For the above example it will say that a grid control named LineSpec does
not have the method visibleRowsValue. But grid controls have that method.
I did not change anything in the form in the AOT. I only add the data source
run time. I tried various stuff to figure out why it does not want to run. If
I change the form in the AOT by adding InventLocation to the datasource then
it will run just fine and not complain about that LineSpec control. If the
form is standard with no modifications and I add the datasource runtime it
don't want to work.
Why not?
I am trying to do this:
form = new Form(formstr(PurchTable));
inventDim_fbds = form.datasource(3);
new_fbds = form.addDataSource(tablestr(InventLocation));
new_fbds.table(tablenum(InventLocation));
new_fbds.joinsource(inventDim_fbds.id());
args = new Args(form);
args.object(form);
formRun = classFactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.detach();
If I try run time in a job to add a datasource to a simple form like for
instance the form InventDim then the above code will work just fine (I did
not include variable declarations in the text). However, as soon as I try and
do it on a form, in which controls are autodeclared then it crashes with a
stack trace saying that the control does not have this or that method or is
not initialized.
For the above example it will say that a grid control named LineSpec does
not have the method visibleRowsValue. But grid controls have that method.
I did not change anything in the form in the AOT. I only add the data source
run time. I tried various stuff to figure out why it does not want to run. If
I change the form in the AOT by adding InventLocation to the datasource then
it will run just fine and not complain about that LineSpec control. If the
form is standard with no modifications and I add the datasource runtime it
don't want to work.
Why not?
--
Kind regards,
Henrik Berg Andersen
Kind regards,
Henrik Berg Andersen