Flowfield to return price for current WORKDATE

Toddy_Boy
Member Posts: 232
Hi Guys
Not sure if this is possible, I have a simple table as below
Start Date End Date Price
01/01/10 31/12/10 £10
01/01/11 31/12/11 £20
01/01/12 31/12/12 £30
Is there a way to put a flow field (i.e. no coding) on this table to return the Current Price i.e. if the workdate is 20/09/12 the table would show as below
Start Date End Date Price Current Price
01/01/10 31/12/10 £10 £30
01/01/11 31/12/11 £20 £30
01/01/12 31/12/12 £30 £30
Cheers
Steve
Not sure if this is possible, I have a simple table as below
Start Date End Date Price
01/01/10 31/12/10 £10
01/01/11 31/12/11 £20
01/01/12 31/12/12 £30
Is there a way to put a flow field (i.e. no coding) on this table to return the Current Price i.e. if the workdate is 20/09/12 the table would show as below
Start Date End Date Price Current Price
01/01/10 31/12/10 £10 £30
01/01/11 31/12/11 £20 £30
01/01/12 31/12/12 £30 £30
Cheers
Steve
Life is for enjoying ... if you find yourself frowning you're doing something wrong
0
Answers
-
There is no way to make flowfields calculated on workdate. Only exception - you can include a datefilter in calculation formula, but you need to set datefilter by code or trough user interface.0
-
Yes I came to that conclusion as well.
Never mind
Life is for enjoying ... if you find yourself frowning you're doing something wrong0 -
Can't you use MAX?David Singleton0
-
Hi David
Not really as there can be prices setup in the future as well as the current and past. Wouldn't using MAX would return the latest price and not the current?
SteveLife is for enjoying ... if you find yourself frowning you're doing something wrong0 -
Toddy Boy wrote:Hi David
Not really as there can be prices setup in the future as well as the current and past. Wouldn't using MAX would return the latest price and not the current?
Steve
Just a small hint when writing specs, always use a realistic data set for the example. In your case coincidentally the last record is the one you want, but in reality that wont happen. Also are the records ALWAYS 1st Jan to 31 Dec, if not then don't use those as examples either.
Anyway, why do you need a flow field? Just create a function, it will do what you want, it's simple and works just the same. And probably will give you better control.David Singleton0 -
Hi David
Could've worded it better but it was getting late in the day. I firstly created a function and then got wrapped in the wrong idea that this may be acheiveable another way. Thought I'd throw it out there in case I missed something.
Regards
SteveLife is for enjoying ... if you find yourself frowning you're doing something wrong0 -
Toddy Boy wrote:Hi David
Could've worded it better but it was getting late in the day. I firstly created a function and then got wrapped in the wrong idea that this may be acheiveable another way. Thought I'd throw it out there in case I missed something.
Regards
Steve
Well what about ppavuk's suggestion:ppavuk wrote:Only exception - you can include a datefilter in calculation formula, but you need to set datefilter by code or trough user interface.
I have done this before and it works fine, just add code to the OnOpenForm trigger to set a date filter field to '..%1',TODAY
But just using a function as the source expression of a control is very reliable.David Singleton0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions