web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

select Record in Purch. Rcpt. Line [121] and send mail to vendors

(0) ShareShare
ReportReport
Posted on by 256

I want to select Record "Buy-from Vendor Name"  and "Qty.Rec.Not Invoiced > 0 " from Purch. Rcpt. Line [121]  table and send mail to vendors

So I Create Code Unit But How to write condition I didn't understand

OnRun()
//VendNo:='01254796';
SMTPSetup.GET;
PurchRcptLine.GET('01254796');
SMTPMail.CreateMessage(SMTPSetup."Email Sender Name",SMTPSetup."Email Sender Email",Vendor."E-Mail",'Test Pending Receipt','',TRUE);
SMTPMail.AppendBody('Vendor No' + PurchRcptLine."Buy-from Vendor No.");
SMTPMail.Send;
MESSAGE('Mail Send');


 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RockwithNav Profile Picture
    9,158 Super User 2026 Season 1 on at

    PurchRcptLine.GET('01254796'); // This code of yours will not work as Line No too is a part of Primary key.

    You can get PurchRcptHdr and then under and then find corresponding PurchRcptLines and then check of you condition for each and every lines

  • Verified answer
    CDsilva Profile Picture
    4,188 on at

    You can follow this blog

    PurchRcptLine.RESET;

    PurchRcptLine.SETFILTER("Qty.Rec.Not Invoiced,'>%1',0);

    IF PurchRcptLine.FINDSET THEN

     //your code to send email

    First you need to fetch the email ID from Vendors table. refer the below blog

    chrisdsilvablog.wordpress.com/.../how-to-setup-a-batch-to-run-daily-and-send-an-email-on-validation-of-a-field-in-microsoft-dynamics-nav

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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans