Hi Experts,
I have a requirement of retrieving value from a field called Applied Amount to Payment Journal Lines.
its like if we going to pay a vendor some money , we have to apply the Open Invoice ,right?
we we click the set applies - id it will apply the selected lines. there will calculation of ‘APPLIED AMOUNT’ at the end of the page.
i want to get this value to show in the PAYMENT JOURNAL LINE RELATED TO THE VENDOR.
it would be great if i got some advice and example.
To retrieve the value from the Applied Amount field in Payment Journal Lines related to a vendor, you can use X++ code to fetch the value and store it in a variable. Here’s an example code snippet:
VendTable vendTable;
PaymentJournalTable paymentJournalTable;
PaymentJournalLine paymentJournalLine;
Real appliedAmount;
select vendTable where vendTable.AccountNum == ‘Vendor Account Number’;
select paymentJournalTable where paymentJournalTable.VendAccount == vendTable.AccountNum;
select paymentJournalLine where paymentJournalLine.JournalNum == paymentJournalTable.JournalNum;
// Loop through payment journal lines related to the vendor and fetch the applied amount value
while select paymentJournalLine where paymentJournalLine.JournalNum == paymentJournalTable.JournalNum
{
appliedAmount = paymentJournalLine.AppliedAmount;
// Use the appliedAmount variable to show the value in the payment journal line related to the vendor
}
You can modify this code snippet as per your requirement and use it to retrieve the value from the Applied Amount field in Payment Journal Lines related to a vendor.