I have a page that show info from table in which "DataPerCompany" property set to 'Yes'. But I have to get data from all companies for my page.
So how to get data from all companies but do not change "DataPerCompany" to 'No' ? may be it could be done by code or some other way
0
Answers
You are trying to display this in a page?
You'll have to make a new staging table that has DataPerCompany = false, load that table in a Company record loop in OnOpenPage, and make a new page that displays the staging table.
Thank you for the answer
So there are no way to do my task without creating new table?
(new table must contain data from my table, doesn't it?)
I know that it is possible to get data from all companies form table with DataPerCompany prop set to 'Yes'. But i don't know how I can produce this
You'll probably have to alter the primary key to include Company Name
Define your new page on top of that table - it can probably use this new table as a temporary table
Then do something like this in a codeunit
Company.FINDSET;
REPEAT
TablePerCompany.CHANGECOMPANY(Company.Name);
IF TablePerCompany.FINDSET THEN REPEAT
BufferTable.TRANSFERFIELDS(TablePerCompany);
BufferTable."Company Name" := Company.Name;
BufferTable.INSERT;
UNTIL TablePerCompany.NEXT = 0;
UNTIL Company.NEXT = 0;
Thank you for answer
Let me know what data type have "Company" variable
(variable "po_l" has Record data type and subtype is the table that have "DataPerCompany" property set to 'Yes' ):
comp_n:= Rec."Order Company Name";
po_l.CHANGECOMPANY(comp_n);