Home
> Ax Technical > Use SysDictField instead of DictField
Use SysDictField instead of DictField
<![CDATA[
Palle Agermark made a wonderful post on Importing table fields in to Excel. if you haven’t checked it just check out
I have some additions to it here,
instead of using Dictfield if you use SysDictField, you can avoid writing the if condition to find the source type
As Posted in Palles code
if (dictField.typeId())
{
excelCell = excelCells.item(rowCounter, #ColumnType);
excelCell.value(new DictType(dictField.typeId()).name());
}
else
{
if (dictField.enumId())
{
excelCell = excelCells.item(rowCounter, #ColumnType);
excelCell.value(new DictEnum(dictField.enumId()).name());
}
}
If you would use SysDictfield
{
excelCell = excelCells.item(rowCounter, #ColumnType);
excelCell.value(new DictType(dictField.typeId()).name());
}
else
{
if (dictField.enumId())
{
excelCell = excelCells.item(rowCounter, #ColumnType);
excelCell.value(new DictEnum(dictField.enumId()).name());
}
}
If you would use SysDictfield
then it will be
excelCell = excelCells.item(rowCounter, #ColumnType);
excelCell.value(sysDictfield.getSourceType());
excelCell.value(sysDictfield.getSourceType());
………….. I guess it’s useful
]]>
Comments (0)
Trackbacks (0)
Leave a comment
Trackback