i am working on form customization and wanted to add invoice amount from vend invoice jour form to Purch Table form. I have used COC to add up the field .
but its not showing any data on purchase order form.
any guidence?
[Extensionof (formStr(PurchTable))] final class PurchTableForm_Extension { public void getInvoiceAmount() { VendInvoiceJour vendinvoicejour; PurchTable purchTable; AmountCur invoiceAmount; select * from vendinvoicejour where purchTable.PurchId == vendinvoicejour.PurchId; purchTable.InvoiceAmount = VendInvoiceJour::findFromPurchId(purchTable.PurchId).InvoiceAmount; } }
Girish ,
this blog helped me , its now working. My issue is solved by display method.
Thanks,
Hi, you don't need select statement. You can refer below code. Have you mapped this method to field in PurchTable form? You can add display method (If you don't want to export data or filter it in form).
public void getInvoiceAmount() { VendInvoiceJour vendinvoicejour; PurchTable purchTable = this.dataSource(IdentifierStr(PurchTable)).cursor(); AmountCur invoiceAmount; purchTable.InvoiceAmount = VendInvoiceJour::findFromPurchId(purchTable.PurchId).InvoiceAmount; }
Hi Junaid,
If you have created new field in the PurchTable then you need to write a script to update the value to the new field for old records. For new records you need to decide when to populate this field.
If it's simple field to display the invoice amount in PurchTable you can go with adding display method instead.
Refer to the below blog for adding display method.
Thanks,
Girish S.
André Arnaud de Cal...
291,969
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156