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
    RockwithNav 6,562 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
    Stefano Demiliani 37,162 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.

  • 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
    Stefano Demiliani 37,162 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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans