Customizing Fields in Dynamics 365 Finance and Operations: Populating Data from Purch line Form to Pending Vendor Invoices Form
Hi everyone,
I am sharing my knowledge on customizing fields in the purchase line form and populating those fields into the pending vendor invoices form in Dynamics 365 Finance and Operations (D365FO). To achieve this requirement, there is a standard class called PurchFormletterParmDataInvoice. Within this class, there is a method named insertParmLine(). By using this method, we can effectively populate purchase line fields into the pending vendor invoice form.
领英推荐
/// <summary>
/// PurchFormletterParmDataInvoice_Extensionis extension to PurchFormletterParmDataInvoice class.
/// </summary>
[ExtensionOf(classstr(PurchFormletterParmDataInvoice))]
public final class PurchFormletterParmDataInvoice_Extension
{
/// <summary>
/// This extension method is to initiate fixed asset fields from purchlines to vendinvoiceinfoline table.
/// </summary>
/// <param name = "_parmLine"></param>
protected void insertParmLine(Common _parmLine)
{
VendInvoiceInfoLine vendInvoiceInfoLine = _parmLine;
PurchLine purchline = PurchLine::findRecId(vendInvoiceInfoLine.PurchLineRecId);
if (purchline)
{
vendInvoiceInfoLine.TT_AssetId = purchline.TT_AssetId;
vendInvoiceInfoLine.TT_AssetIdFinal = purchline.TT_AssetIdFinal;
_parmLine = vendInvoiceInfoLine;
}
next insertParmLine(_parmLine);
}
}
This method will be triggered in different scenarios, such as while opening the invoice form for purchase orders and selecting order quantity from the VendEditInvoice form and VendorPendingInvoice form. It is used for fetching data from purchase lines to pending vendor invoices.
--
7 个月Very helpful!??