X++ Code to Hide (or) Restrict Enum values in the dialog in AX 2012 R3
// SalesStatus enum value to show only the BackOrder & Invoiced status in the dialog
public class RBHideEnumValues extends RunBaseBatch
{
DialogEnumComboBox dialogEnumComboBox;
DialogField dialogSalesStatus;
DialogRunBase dialog;
SalesStatus salesStatus;
}
{
DialogEnumComboBox dialogEnumComboBox;
DialogField dialogSalesStatus;
DialogRunBase dialog;
SalesStatus salesStatus;
}
public Object dialog()
{
Set enumSet = new Set(Types::Enum);
{
Set enumSet = new Set(Types::Enum);
DialogRunbase dialog = super();
;
dialogSalesStatus= dialog.addField(enumstr(SalesStatus));
dialogSalesStatus.value(salesStatus);
enumSet.add(SalesStatus::Backorder);
enumSet.add(SalesStatus::Invoiced);
dialogEnumComboBox = DialogEnumComboBox::newParameters(null, dialogSalesStatus.control().id(), enumNum(SalesStatus), enumSet, dialog.form());
return dialog;
}
No comments:
Post a Comment