Hi All,
I am retrieving data from four tables from a single XML port. I can able to get the records of 4 tables for the current company.
But i want to get the same for 5 companies out of 6(i have 6 companies). I know we can use CHANGECOMPANY function. But I don't know exactly where we have to use the CHANGECOMPANY in xml port triggers.
Can you please suggest me some ideas to get all the four table data for 5 companies out of 6.
Thanks in advance,
Jacob.A
0
Answers
Never done this, though, so I don't know if this will work.
RIS Plus, LLC
Hi @DenSter ,
I am trying as per your suggestion first for one company. But it's not working.please find the below attachments.
Dataitem added in XMLport:
Code snippet added in onprexml trigger:
Please help me...
Thanks in advance,
Jacob.A
Most other tables are not global tables, which means that there is a physical table for each company. For instance, if you have two companies, you will have two Item tables, one for each company.
Normally, you log into a company, and then you can only see the tables for that company. The CHANGECOMPANY command is used to be able to read the table in another company. So if you are logged into 'Company A', you can read the items from 'Company B' by doing "Item.CHANGECOMPANY('Company B')".
What I would try is to have a dataitem for the Company table, and everything else indented to that dataitem:
-- Company
---- Item
So for each record in the company table, it will read all the records in the Item table. All you would need to do is issue a CHANGECOMPANY command for the Item table in OnPreDataitem.
What you did wrong is changing the copany for the company table, which is not necessary. You need to change the company of the other tables.
RIS Plus, LLC