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)

how to set report filter in automatically

(0) ShareShare
ReportReport
Posted on by 20

Hi Experts,

i want to send to mail automatically with reports, how to get report filters from form automatically, based on customer id from form i want to get filter in my report 

2084.smtp.png

Thank you

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Not so clear the scenario. The selected record on this page is the Rec variable. On the click of your button you can pass to your report the value you need (Rec.No or other).

  • Dillibabu Rajendran Profile Picture
    20 on at

    Hi Stefano,

    i will send report using job queue it will send the mail automatically and need to set filter based on my form customer ids automatically.

    Path := 'C:\\Temp'+PdfDocPath;

    path2 := 'C:\\Temp1'+pdf2;

    CLEAR(CustomerLedgerReport); // AccountsPayable is a Report 322

    CustomerLedgerReport.USEREQUESTPAGE(FALSE); //// for filteration

    CLEAR(AccountsReceivable); // AccountsReceivable is a Report 12

    AccountsReceivable.USEREQUESTPAGE(TRUE);

    EVALUATE(PeriodLength,'3D');

    DateAsOf := 240119D;

    AccountsReceivable.InitializeRequest(DateAsOf, AgingBy::"Due Date", PeriodLength, TRUE, TRUE, HeadingType::"Date Interval", FALSE);

    IF NOT AccountsReceivable.SAVEASPDF(path2) AND CustomerLedgerReport.SAVEASPDF(Path) THEN

    ERROR('PDF Creating Failed!\\ERROR:\\' + GETLASTERRORTEXT);}

    //seremail.SETRANGE(No,No);

    SMTP.CreateMessage('wood','Dillibabu@gmail.com','','outstanding amount','',TRUE);

    SMTP.AddCC('ashwini.e@sharpsyssoft.com');

    SMTP.AppendBody('Dear Sir / Madam,');

    SMTP.AppendBody('<br><br>');

    SMTP.AppendBody('Please find the Receivable/Payable Details in PDF Format:');

    SMTP.AppendBody('<br><br>');

    SMTP.AppendBody('Regards');

    SMTP.AppendBody('<br>');

    SMTP.AppendBody('Accounts Departments');

    //SMTP.AddAttachment(path2,pdf2);

    //SMTP.AddAttachment(Path,PdfDocPath);

    this is my code i have called this in codeunit and created job queue  for automatic email.

    Please tell me how to take customer id as filter in my report from form

    Thank you

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Job Queue process runs in background, so you can't take as input a selection in a page.

    If this is not used via Job Queue but via user interface, your Customer ID is Rec."Customer No." as I see in your image.

  • Suggested answer
    RockwithNav Profile Picture
    8,637 Super User 2025 Season 2 on at

    Can you be a level more specific on your Question please.??

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)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans