hi,
I created a job to import budget transaction lines, the line dimension values contains only dimensions without Main account ID; below is my code:
bbudgetTransactionLine = new AxBudgetTransactionLine();
bbudgetTransactionLine.parmBudgetTransactionHeader(BudgetTransactionHeader::findByTransactionNumber(Transaction_TransactionNumber.text(),Ledger::current()).RecId);
bbudgetTransactionLine.parmDate(str2Date(conPeek(readCon,6),123));
bbudgetTransactionLine.parmTransactionCurrency(conPeek(readCon,8));
bbudgetTransactionLine.parmBudgetType();
bbudgetTransactionLine.parmTransactionCurrencyAmount(str2num(conPeek(readCon,12)));
bbudgetTransactionLine.parmAccountingCurrencyAmount(str2num(conPeek(readCon,12)));
accEntryPattern = [strFmt("%1-%2",conPeek(readCon,9),conPeek(readCon,10)),0];
if(conPeek(readCon,9))
{
accEntryPattern += "Budget";
accEntryPattern += conPeek(readCon,9);
dimcount++;
}
if(conPeek(readCon,10))
{
accEntryPattern += "BUDGETYEAR";
accEntryPattern += conPeek(readCon,10);
dimcount++;
}
accEntryPattern = conIns(accEntryPattern,3,dimcount);
bbudgetTransactionLine.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(accEntryPattern));
bbudgetTransactionLine.save();
when running the code the following error occurs:
"The main account 0 does not exist".
the issue is that the main account cannot be empty or have 0 as a value. how can i pass the parameter for parmLedgerDimension function in the BudgetTransactionline class.
any suggestion will be highly appreciated!
thank you.
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (