开发者

How to keep a single XPO across different versions?

开发者 https://www.devze.com 2023-01-06 03:16 出处:网络
I want to have one XPO, 开发者_开发知识库and have the same code work on AX4 and AX5. I am looking for a precompiler directive to check the version, sort of like:

I want to have one XPO, 开发者_开发知识库and have the same code work on AX4 and AX5. I am looking for a precompiler directive to check the version, sort of like:

#if define AX4
  thisCode(...)
#else
  thatCode(...)
#endif


It looks like the SysDataExpImp macro library may have a version based macro called expFormat which you could use like this:

#SysDataExpImp
#if.expFormat('EXPFORMAT VER. 5.0')
info('Microsoft Dynamics AX 2009');
#endif
#if.expFormat('EXPFORMAT VER. 4.01')
info('Microsoft Dynamics AX 4.0 SP1');
#endif

You could also use a macro that is only found in AX 2009. The AotExport macro library has macros for each type of AOT object and Data Sets were introduced in 2009:

#AotExport
#if.expDataSet
info('Microsoft Dynamics AX 2009');
#endif
#ifnot.expDataSet
info('older than Microsoft Dynamics AX 2009');
#endif
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号