1

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
Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
esac
  • 24,099
  • 38
  • 122
  • 179

1 Answers1

1

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
Jay Hofacker
  • 3,439
  • 20
  • 14