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; } }
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.
https://community.dynamics.com/365/financeandoperations/b/howtodynamics365/posts/how-to-create-display-method-for-table-extension-in-dynamics-365
Thanks,
Girish S.
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; }
Girish ,
this blog helped me , its now working. My issue is solved by display method.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 683 Most Valuable Professional
André Arnaud de Cal... 563 Super User 2025 Season 2
Sohaib Cheema 398 User Group Leader