Is there any possibility to make use of windows-environment-variables in AX?
Example:
Property NormalImage
on a MenuItem
. I'd like to use sth. like %USERNAME% instead of the explicit username. In Classes for example I can use the WINAPI
macro and refer to a user-folder-variable, eg CSIDL_MYPICTURES
, to access the path per user. In AOT-object-properties there's no possibility to reference to macros...
Any way to achieve this?
An example of getting the client name and machine name
Yes you can use .Net framework to get environment variables or you can use built in AX functions. See this example I typed up:
See http://msdn.microsoft.com/en-us/library/system.environment.getenvironmentvariable.aspx
No, you can't do this on the AOT. You can change some properties on runtime through X++ code, but you can't dynamically change the image on a MenuItem as far as I know.
You can make visible/invisible some menuitems. May be can simulate what you are trying to do this way, although this is not quite aligned with the AX design patterns.