In AX2009 I have created a new number sequence and added it into the LedgerJournalTransVendPaym form’s LedgerJournalTrans datasource. My intention was to populate the PaymId field with a distinct number for each batch of ACH payment transactions processed. An error occurs with message below. It fails because the LedgerJournalEngine has not been initialized. I tested this number sequence successfully in two other test forms that did not use LedgerJournal classes. Is this error due to my lack of familiarity with the LedgerJournalEngine and its use in the LedgerJournalTransVendPaym?
I very much appreciate any help on this. Or just a hint to point me in the right direction.
HERE IS THE ENTIRE ERROR MSG
Error executing code: LedgerJournalEngine object not initialized.
(C)\Classes\LedgerJournalEngine\takeNewVoucher
(C)\Classes\NumberSeqFormHandlerLedgerJournal\formMethodDataSourceCreate - line 5
(C)\Forms\LedgerJournalTransVendPaym\Data Sources\LedgerJournalTrans\Methods\create - line 28
(C)\Classes\FormDataSource\executeQuery
(C)\Classes\FormDataSource\linkActive
(C)\Forms\LedgerJournalTransVendPaym\Data Sources\LedgerJournalTrans\Methods\linkActive - line 10
HERE IS THE METHOD FAILING ON LINE 5
void formMethodDataSourceCreate(boolean _forced = false)
{
;
newVoucher = false;
if (ledgerJournalEngine.takeNewVoucher()) << Line 5
{
super();
if (lastNumber)
{
newVoucher = true;
currentNewUnsaved = 0;
}
}
currentNewUnsaved++;
}
HERE IS MY CODE PERTINENT TO THE FORM AND DATASOURCE
LedgerJournalTransVendPaym
class FormRun extends ObjectRun
{
NumberSeqFormHandler numberSeqFormHandler;
}
LedgerJournalTrans write
super();
element.numberSeqFormHandler().formMethodDataSourceWrite();
LedgerJournalTrans validateWrite
super();
ret = element.numberSeqFormHandler().formMethodDataSourceValidateWrite(ret) && ret;
return ret;
LedgerJournalTrans delete
element.numberSeqFormHandler().formMethodDataSourceDelete();
super();
LedgerJournalTrans create
element.numberSeqFormHandler().formMethodDataSourceCreatePre();
super(append);
element.numberSeqFormHandler().formMethodDataSourceCreate();
LedgerJournalTrans linkActive
element.numberSeqFormHandler().formMethodDataSourceLinkActive();
super();
THIS IS THE SEQ NUM SETUP
/*Setup payment reference for CIBC CAD Payment Id's*/
numRef.DataTypeId = typeId2ExtendedTypeId(typeid(CADPaymId));
numRef.ReferenceHelp = literalstr("CAD Payment Id");
numRef.WizardHighest = 9999999;
numRef.WizardLowest = 1;
numRef.WizardContinuous = true;
numRef.WizardManual = NoYes::No;
numRef.WizardAllowChangeDown = NoYes::No;
numRef.WizardAllowChangeUp = NoYes::No;
numRef.SortField = 5;
this.create(numRef);