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 246

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

  • Verified answer
    CDsilva Profile Picture
    CDsilva 4,184 on at
    RE: select Record in Purch. Rcpt. Line [121] and send mail to vendors

    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

  • Suggested answer
    RockwithNav Profile Picture
    RockwithNav 6,562 on at
    RE: select Record in Purch. Rcpt. Line [121] and send mail to vendors

    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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans