最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Enum value to Table Insertion Dynamics Ax 2012 R3, D365 for operations

网络文摘 alirazazaidi 3234浏览 0评论

Let me share you a small tip, During customization We extend out of box Enum for classification. Later client requirement is extensive usage of new Values for classification. For adding new values in enum results dependency on technical person . So we did customization and provide form and custom table so he can create number of values as he want. But now next challenge was, copy enum values and labels in Custom table, So He can use these value instead create again. I used following code snippet to copy data from Enum and insert into Custom table. Hopes this helps.

 

EnumId   enumId   = enumNum(LedgerPostingType);

DictEnum dictEnum = new DictEnum(enumId);

int      _NoOfValueInEnum = dictEnum.values();

int      counter;

CustomTable  _header;

delete_from _header;

for(counter = 0; counter < _NoOfValueInEnum; counter ++)

{

_header.ReportHeaderCode = dictEnum.index2Label(counter);

_header.Description = dictEnum.index2Label(counter);

_header.SortOrder=0;

_header.EnumValue = dictEnum.index2Value(counter);

_header.insert();

 

}
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址