Global variable declaration..

Dear All
where we declare global variables.i want to use value of that global variable in entire application.

Well, this is not Navision, so you can’t really declare a Global variable But you can check our the TreeNode: Classes\Global and Classes\Application. You can, basically use these classes for your purposes. Just be careful with what you do in them. Also, if you just need a constant value, you can use a Macro and, if you need even something more than that, you can always create a table, call it, say, GlobalVars and insert values there whichever way you want (meaning, static number of columns or a container column) Examples of this you can find in tables named: *Parameters And PLEASE, stop posting to both Technical and Developers forums at once – most of the users read both forums and your question will be answered in one of them. Thanks for understanding, and Good luck with adding global variables


You may have to try apply the SingleTon parttern to design a class wich heve only one instance for the whole application session. And this will help you to solve your problem.

Take a look at:

Hope it helps.


Do please search for GlobalCache in Axapta Developers guide. Just curious - why do you need to declare a global variable? Please let us know.



My requirement is quite same with the subject of this post.

I wanted to call methods from my own COM library(built with un-managed code VC++). I am using its methods in multiple modules e.g. SalesLedger, Production, Stock Ledger etc. And I wanted to initialize it only once and use its object throughout the modules mentioned above.

Please help to get rid of it.