1.首先,打开AOT并在Table Browser中找到“PaymentJournalTrans”表。找到字段“LineText”并打开它。
2.'ExtentedDataType”更改为“ExtentedString”.
3.更改字段的长度。在“Properties”窗格中找到“StringSize”属性,将其更改为所需的值。
4.保存更改并重新启动Dynamics AX客户端,以使更改生效。
示例代码:
static void ExtendPaymentJournalTransactionText(Args _args)
{
TableId tableid;
DictTable dicttable;
DictField dictfield;
int newsize = 255;
// Get table id for PaymentJournalTrans table
tableid = tableNum(PaymentJournalTrans);
// Get table dictionary object
dicttable = new DictTable(tableid);
// Get field dictionary object for LineText field
dictfield = dicttable.fieldNum(PaymentJournalTrans_LineText);
// Change ExtendedDataType to ExtendedString
dictfield.extendedDataType(typeId(ExtendedString));
// Set new string size for field
dictfield.stringSize(newsize);
// Save changes
dictfield.save();
dicttable.save();
info(strfmt("PaymentJournalTrans_LineText field size changed to %1", newsize));
}