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

Notifications

Announcements

No record found.

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
    8,637 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans