Below is the code I have written in D365 F&O for getting the invoice numbers for payments which are settled with the invoices.
Please change the code according to your requirement.
class VendTransTest
{
/// <summary>
/// Runs the class with the specified arguments.
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
VendTrans vendTransPayment, vendTransinvoice;
TransDate fromTransDate = 01\01\2018;
TransDate toTransDate = str2Date("12/31/2018", 213);
;
while select vendTransPayment where vendTransPayment.TransType == LedgerTransType::Payment
&& vendTransPayment.TransDate >= fromTransDate
&& vendTransPayment.TransDate <= toTransDate
{
while select vendTransinvoice where vendTransinvoice.LastSettleVoucher == vendTransPayment.Voucher
{
info(vendTransinvoice.invoice);
}
}
}
}
}
@Rahul
Please change the code according to your requirement.
class VendTransTest
{
/// <summary>
/// Runs the class with the specified arguments.
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
VendTrans vendTransPayment, vendTransinvoice;
TransDate fromTransDate = 01\01\2018;
TransDate toTransDate = str2Date("12/31/2018", 213);
;
while select vendTransPayment where vendTransPayment.TransType == LedgerTransType::Payment
&& vendTransPayment.TransDate >= fromTransDate
&& vendTransPayment.TransDate <= toTransDate
{
while select vendTransinvoice where vendTransinvoice.LastSettleVoucher == vendTransPayment.Voucher
{
info(vendTransinvoice.invoice);
}
}
}
}
}
@Rahul
No comments:
Post a Comment