Привет всем.
Перекладываю код Ax4 на 2012-ю.
Есть код
X++:
journalTrans_ds.object(fieldnum(LedgerJournalTrans, AccountNum)).mandatory(true);
нужно сделать аналогично в 2012-й.
Попробовал решить задачу "в лоб".
Завел в классах
DimensionDynamicAccountController
LedgerDimensionAccountController
LedgerDimensionDefaultAccountController
свойство parmMandatoryMainAccountSegment
(все аналогично parmLockMainAccountSegment)
и тут опаньки - в классе FormSegment нет свойства mandatory !
т.е. не прокатит написать
X++:
public boolean parmMandatoryMainAccountSegment(boolean _mandatoryMainAccountSegment = mandatoryMainAccountSegment)
{
mandatoryMainAccountSegment = _mandatoryMainAccountSegment;
if (!prmisDefault(_mandatoryMainAccountSegment) && this.parmControl() != null)
{
// Update the control with the appropriate state
this.parmControl().getSegment(#SegmentIndex_MainAccount).mandatory(mandatoryMainAccountSegment);
}
return mandatoryMainAccountSegment;
}
Хотя есть allowEdit, enabled и.т.п.
Интересно, почему так сделано ?
А самое главное, как правильно было бы решать такую задачу ?
Вломиться в методы validate*() и дописать там свои проверки ?