Hi Guys,
I have designed one dataport (DATAPORT) to extract data from a G/L Entry table (GLE Table) and simultaneously I am saving those data in another new table say NEWTABLE, with few fields. From this new table, I am doing few grouping calculations and exporting the grouped data again via a processing only report. This entire flow is working fine. [I need both text files - i.e., before and after grouping]
What should I need to do to save data of all companies (in same database) in the NEWTABLE when the DATAPORT is triggered? This helps me in grouping based of "GL Account No." for all the companies and export it as a single text file as output via processing only report.
Can anyone guide me to do the above?
Thanks and Regards,
Aravindh R.
0
Comments
1) Set the property 'DataPerCompany" off your NEWTABLE to "No.", that way it's contents is available from every company.
2) Use NEWTABLE.ChangeCompany('<name of company>') to select the company you want your data to be saved in and then insert it.
I did as you have mentioned in you reply.
1. G/L Entry is the dataitem. (For an information, I have placed 5 G/L Entry dataitems for exporting in different filtering conditions.)
2. recCompany - Record variable - Company
3. NEWTABLE - Record Table - <Table newly created to store records> (Set the "DataPerCompany" property to NO)
4. varDate and varCode are the Date and Code datatype fields respectively. (I have declared many variables for exporting it through dataport fields.)
5. And done code in below trigger.
Seems it is looping 'n' no. of times and finally showed the message to Expand the Database. Can anyone tell me whether the above code is correct? If not correct me where I am going wrong.
RecVar.CHANGECOMPNAY("Company Name");
Now this record var will be referencing to the company has used in function.
Pargesoft
When I look at your code it seems you are looping in a dataitem (GL Entry) and I think you should use a record variable instead. If you want to use this G/L Entry as dataitem, you have to loop in Company as first dataitem and then the G/L Entry dataitem which is indented under the Company.
Pargesoft
Note- For indent within two dataitem it's not mendatory that both dataitem must have common field.
I am extremely sorry for confusing you all #-o . The previous code itself is working . I am using a variable inside loop to define the company name which reads the current company name (COMPANYNAME). Instead I need to give it as recCompany.Name for that variable.
Thanks all.
Aravindh.