Hi everyone
If you create a new vendor invoice, you can add charges to it from the front end. I'm trying to do this in code.
My code looks like this:
MarkupTrans markupTrans;markupTrans.initValue(); // or initFromVendInvoiceInfoTable()
markupTrans.AllOtherFields = someValues;
markupTrans.insert();
When I do this, I can't see my new charge from the front end because although it exists, the front end looks for a markupTrans record created against the VendInvoiceInfoSUBTable instead.
When I create a new record from the front end it also inserts the record against VendInvoiceInfoSUBTable. The code that calls the charge form is this:
void clicked()
{
VendInvoiceInfoSubTable vendInvoiceInfoSubTable;if (VendInvoiceInfoSubTable::count(vendInvoiceInfoTable.ParmId, vendInvoiceInfoTable.TableRefId) > 1)
{
// more than one PO on the Invoice, so edit the summary invoice
element.editMarkupTrans(this.menufunction(), vendInvoiceInfoTable);
}
else
{
// only one PO on the Invoice, so edit it
select firstonly vendInvoiceInfoSubTable
where vendInvoiceInfoSubTable.TableRefId == vendInvoiceInfoTable.TableRefId
&& vendInvoiceInfoSubTable.ParmId == vendInvoiceInfoTable.ParmId;element.editMarkupTrans(buttonSubTableMiscCharges.menufunction(), vendInvoiceInfoSubTable);
}
}
So, why if creating a record from VendInvoiceInfoTable does the standard code convert it into a vendInvoiceInfoSUBTable record? Why doesn't it just use the VendInvoiceInfoTable record I'm on? How does this affect how I should be creating a new charge record against a vendor invoice in code? How should I be doing that? As far as I know, VendInvoiceInfoSubTable relates vendor invoices to Purchase orders, but I don't always have a purchase order.
Thanks

Report
All responses (
Answers (