web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Setting a Date Range in Calcformula in Development Environment

(0) ShareShare
ReportReport
Posted on by

Hi

I am in the development environment of a "cue" I have created and want to create a stack for a role to show the current weeks sales quotations.

I am aware that within NAV 2013 for all cue's two date formulas are available as standard to use which are "Date Filter" & "Date Filter2"  These are hard coded in the system and when used within any of the objects calcformulas they show records for either the current day or up to the prior day.

I want to create a stack within a cue to show all sales quotations for the current week.  I have created this field but in the properties of the calcformula I can't get the filter to recognise the current week "CW" so that it filters these records.

I would appreciate anyone's help on this as it must be something so simple I am missing.

Thanks

*This post is locked for comments

I have the same question (0)
  • Suresh Kulla Profile Picture
    50,278 Super User 2026 Season 1 on at

    Try to use setrange on DateFilter2

    StartDate := CALCDATE('<CW+1D-1W>',TODAY);

    EndDate :=  CALCDATE('<CW>',TODAY);

    SETRANGE("Date Filter2",StartDate,EndDate)

    You have to add the above filter on the open page trigger of the page. For example look at page 9050

    Then you use the Date Filter 2 in the field

  • Community Member Profile Picture
    on at

    Thanks for your quick reply.

    If I try and use the standard NAV Date Filter2 field, within the cue, how do I get to the "Setrange" as I can't get into the formula as it is hard coded.  This is why I thought I needed to create a new one?

    Please advise.

  • Community Member Profile Picture
    on at

    Where abouts in the page 9050 am I to look?  I am in the object design of Page 9050 and not sure where you are looking.

    Please advise.

  • Suresh Kulla Profile Picture
    50,278 Super User 2026 Season 1 on at

    Design the page and look at the code not sure if you have access to it. ?

    For your cue you need to add a field in the table, and for that field use calcformulae with date filter 2 field or new field Date Filter 3 then in the on open page you will add the code i have shown above.

  • Community Member Profile Picture
    on at

    Hi

    I am not sure I can get to the code??

    If I go into the design view of i.e page 9050 or even my page what do I then press to get to the code.  When I press (F9) nothing happens.  Does this mean I don't have permission?

    I do have administrator rights so would I need to ask our support team to alter my permissions or is there another way to get around this?

    Please advise.

  • Community Member Profile Picture
    on at

    Hi

    Just a thought...

    In the design view of the cue, can I not insert any code into the calcformula section of the properties for it to recognise the current week?  At present what is shown in here at present is: -

    Count("Sales Shipment Header" WHERE (Posting Date=FIELD(Date Filter2)))  Obviously Date filter 2 shows all posted sales shipments for that day

    I can also change this calcformula to show this weeks posted shipments as follows: -

    Count("Sales Shipment Header" WHERE (Posting Date=FILTER(20/07/15..26/07/15)))

    however this filter is then held for this week with the dates specified so when we get to next week it will not refresh.

    Is there nothing I can enter into this area for the system to recognise each CW current week?

    Please advise.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
TAHER_El_Mehdi Profile Picture

TAHER_El_Mehdi 2

#1
sliderxb Profile Picture

sliderxb 2

#1
broberts Profile Picture

broberts 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans