Options

Flowfield to return price for current WORKDATE

Toddy_BoyToddy_Boy Member Posts: 231
edited 2012-09-21 in Navision Financials
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
Life is for enjoying ... if you find yourself frowning you're doing something wrong

Answers

  • Options
    ppavukppavuk Member Posts: 334
    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.
  • Options
    Toddy_BoyToddy_Boy Member Posts: 231
    Yes I came to that conclusion as well. :( Never mind
    Life is for enjoying ... if you find yourself frowning you're doing something wrong
  • Options
    David_SingletonDavid_Singleton Member Posts: 5,479
    Can't you use MAX?
    David Singleton
  • Options
    Toddy_BoyToddy_Boy Member Posts: 231
    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
    Life is for enjoying ... if you find yourself frowning you're doing something wrong
  • Options
    David_SingletonDavid_Singleton Member Posts: 5,479
    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 Singleton
  • Options
    Toddy_BoyToddy_Boy Member Posts: 231
    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
    Life is for enjoying ... if you find yourself frowning you're doing something wrong
  • Options
    David_SingletonDavid_Singleton Member Posts: 5,479
    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 Singleton
Sign In or Register to comment.