Discussion:
Changecompany appl.setDefaultCompany ??
(too old to reply)
Arne
2010-07-23 08:36:54 UTC
Permalink
Hi.

Just found out something strange about ChangeCompany and
appl.setDefaultCompany.

That I cannot pass a record as record parameter in the Args when opening a
form in another company. The problem then is that during the init method of
the form the application changes back to the original company.

And when I set element as caller in the Args, call a method on the caller in
the new forms init method and set the record that way. It all works perfect.


appl.setDefaultCompany(companyB,false);

args.record([tablename]); //does not work
formrun = new Menufunction(menuItemdisplaystr([MenuItemName],
MenuItemType::display).create(args);
formrun.init(); // changes back to original company here
formrun.run();
formrun.wait();

appl.setDefaultCompany(companyA,false);


Can anybody explain why this does not work, when obtaining the table through
the called forms init method works perfect?
Luegisdorf
2010-08-17 08:49:03 UTC
Permalink
Hi Arne

May be, your args.record() is refering still to the companyA so the form
obtain from the record's company?

Regards
Patrick
Post by Arne
Hi.
Just found out something strange about ChangeCompany and
appl.setDefaultCompany.
That I cannot pass a record as record parameter in the Args when opening a
form in another company. The problem then is that during the init method of
the form the application changes back to the original company.
And when I set element as caller in the Args, call a method on the caller in
the new forms init method and set the record that way. It all works perfect.
appl.setDefaultCompany(companyB,false);
args.record([tablename]); //does not work
formrun = new Menufunction(menuItemdisplaystr([MenuItemName],
MenuItemType::display).create(args);
formrun.init(); // changes back to original company here
formrun.run();
formrun.wait();
appl.setDefaultCompany(companyA,false);
Can anybody explain why this does not work, when obtaining the table through
the called forms init method works perfect?
Loading...