I have a need to return the Due Date from the Vendor line in LedgerJournalTrans in a ViewComputedColumn.
I have tried using both a Date computed column, and a DateTime computed column, but it always comes up as an empty field when I'm looking at the view. I'm trying to return the actual value that comes from a method I already have that looks up the Vendor line based on the JournalNum of the invoice.
My view method looks like this:
private static server str GetSQLForDueDate()
{
LedgerJournalTrans vendorRecord;
LedgerJournalId journalNum = SysComputedColumn::returnField(tableStr(BTCAPMainAccrualNonPOReportView), identifierStr(LedgerJournalTrans), fieldStr(LedgerJournalTrans, JournalNum));
// Here is where I get the Vendor LedgerJournalTrans record based on the journalNum. This method is proven to work fine, it is used elsewhere in my product.
vendorRecord = BTCAPUtilities::GetVendorRecord(journalNum);
return SysComputedColumn::returnLiteral(vendorRecord.Due);
}
What am I missing? Am I returning the value incorrectly?