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

  • Suggested answer
    RockwithNav Profile Picture
    6,650 on at
    RE: how to set report filter in automatically

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

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: how to set report filter in automatically

    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.

  • Dillibabu Rajendran Profile Picture
    20 on at
    RE: how to set report filter in automatically

    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
    RE: how to set report filter in automatically

    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).

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