[ExtensionOf(tableStr(VendInvoiceInfoLine))]
final class VendInvoiceInfoLine_Extension
{
// Static display method to fetch ConfirmedTaxAmount from PurchLine
display public static real displayConfirmedTaxAmount(VendInvoiceInfoLine _vendInvoiceInfoLine)
{
PurchLine purchLine;
// Retrieve the related PurchLine record based on OrigPurchId and InventTransId
select firstonly purchLine
where purchLine.PurchId == _vendInvoiceInfoLine.OrigPurchId
&& purchLine.InventTransId == _vendInvoiceInfoLine.InventTransId;
// Return ConfirmedTaxAmount if PurchLine is found, otherwise return 0
return purchLine ? purchLine.ConfirmedTaxAmount : 0;
}
// Static method to test updating RealAmount for VendInvoiceInfoLine
static real TestVendInvoiceInfoLine(Args _args)
{
VendInvoiceInfoLine vendInvoiceInfoLine;
if (vendInvoiceInfoLine)
{
PurchLine purchLine;
// Retrieve the related PurchLine record
select firstonly purchLine
where purchLine.PurchId == vendInvoiceInfoLine.OrigPurchId
&& purchLine.InventTransId == vendInvoiceInfoLine.InventTransId;
if (purchLine)
{
vendInvoiceInfoLine.RealAmount = purchLine.ConfirmedTaxAmount;
vendInvoiceInfoLine.update(); // Save the updated RealAmount to the database
info(strFmt("RealAmount updated successfully to: %1", vendInvoiceInfoLine.RealAmount));
return vendInvoiceInfoLine.RealAmount; // Return the updated RealAmount
}
else
{
info("No matching PurchLine found.");
return 0; // Default return if no matching PurchLine is found
}
}
else
{
info("No matching VendInvoiceInfoLine found.");
return 0; // Default return if no VendInvoiceInfoLine is found
}
}
}
I've updated my code first function display only without saving in Database 2nd function trying to save data in database while creating EDT Real and add it in VendInvoiceInfoLine table then drag this and drop it in vendEditInfo form .. what i can do to let it to be retrieved in EDT Real
