I have a form with a button. When the button is clicked, a dataport should be called for each company in the company-table. This part is already working.
The dataport that is being called in the loop, contains a dataItem which is not shared through the companies. I want to do a changecompany on that dataItem before I call the RUN-function of the dataItem from my form. Is that possible and if so, how should I do that?
0
Comments
You will need to run the dataport once, then on the dataitem that is not global, create a variable of the same record. Do a rec.changecompany(newco), and then you can set the rec = dataitemrec and do an insert or modify. Do this for each company (you can use a loop to do that).
Be careful when validating fields on this dataitem, as it validates agains tables in the current database, i.e. if you do a get on a customer no, then it will check if the customer exists in the current company, not on the changed company.
By the way... you should look into making that table global as well, if possible.
Cheers,
Gus