Notifications
Announcements
No record found.
Hi, I've written this C/AL code to query dimensions from the database and for eachdimension I query its dimension values. The queries work as expected, I use'MESSAGE' function to display and test values - it's fine. The problem is that Ineed to pass the dimensions and dimension values to a code unit and I'd like topass them as objects, instead of arrays of string (using Array .NET interoperability)- for each specific property I must have different array and it's not practical for me.So here is my C/AL code, can you give me a piece of advice how to proceed?FOREACH CurrentDimensionTemp IN DimensionNamesArray DO BEGIN DimensionsQuery.SETFILTER(Code, '=' + CurrentDimensionTemp.ToString()); DimensionsQuery.OPEN(); WHILE DimensionsQuery.READ DO BEGIN DimensionValuesQuery.SETFILTER(Dimension_Code, '=' + DimensionsQuery.Code); DimensionValuesQuery.OPEN(); WHILE DimensionValuesQuery.READ DO BEGIN MESSAGE(DimensionsQuery.Code + ' : ' + DimensionValuesQuery.Code); END; END; END;
Thanks!
*This post is locked for comments
Hi,
Could you mention your requirement?
I need to pass my dimension and dimension values to Consolidation Import/Export XMLPort through Consolidation code unit (432) and to export them in XML format along with default consolidation export.
You may write the data in an XML file and pass it. But 432 Codeunit expects a record of "Business Unit" or are you planning to use a specific function from CU 432?
Yeah, I'm planning to use ExportToXML function from the 432 Codeunit to export my dimension and dimension values along with the rest of the xml structure (because 432 Codeunit sets things like glAccounts, etc...).
create a new global function in your codeunit. declare one or two paramters of type record and subtype dimension/dimension value for the function, set the paramters as VAR paramter. so you can pass a single or a set of records to your function.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
HoangNam 7