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

  • Verified answer
    CDsilva Profile Picture
    4,188 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
    6,772 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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans