20 September 2011

Remove Base Enum elements during run time in Dialog

Hi All

Now you can remove the unwanted elements of your Base Enum during the run time in dialog box.

All you need to do id write this method in your dialog class

public void dialogPostRun(DialogRunbase _dialog)
{
FormRun formRun;
set removeValues;
SysDictEnum dictEnum;
int i,j, enumCount;
;
removeValues = new Set(Types::String);
removeValues.add("None");
removeValues.add("Requested");
removeValues.add("Sent");
acceptedValues = new Map(Types::Integer, Types::Enum);

dictEnum = new SysDictEnum(enumNum(SampleStatus));
enumCount = dictEnum.values();
super(_dialog);
formRun = _dialog.formRun();
formComboBoxControl = formRun.design().controlName(ResetStatus.name());
formComboBoxControl.clear();
for(i = 0; i {
if (removeValues.in(dictEnum.index2Label(i)))
{
continue;
}
formComboBoxControl.add(dictEnum.index2Label(i));
acceptedValues.insert(j, dictEnum.index2Value(i));
j++;
//

}

formComboBoxControl.selection(0);

}

Step 2:

public object dialog()
{
DialogRunbase dialog = super();

;
ResetStatus = dialog.addFieldValue(typeid(SampleStatus),sampleStatus,"SampleStatus");
dialog.allowUpdateOnSelectCtrl(true);
// write the above line in your dialog method.
ResetStatus.displayLength(40);

return dialog;
}


No comments:

Post a Comment

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...