Dateformula vs text

xavigepexavigepe Member Posts: 185
I have a dateformula field where user inputs the validity of the quote. For example 3W (three weeks in English) or 3S (three weeks in Spanish); when I print the quote I want to show 3 weeks/semanas instead of 3W/3S.
Anyone knows how can I convert my dateformula into a text depending on the current language Navision is using?.

Thanks so much and merry x-mas to everybody.

Comments

  • kinekine Member Posts: 12,562
    It will be hard, you will need to do some rutine which format the value into string and than you parse the string and create the text (like transforming number into text). But what you will do with formulas like "BM-1M+3W+5D"? ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ara3nara3n Member Posts: 9,256
    I would instead of having a dateformular field have a code lookup to a table. The table will have Code as PK. It will have DateCalculationFormular and description.

    The user can enter the description.

    Another solution would be to use duration.
    Newdate := calcdate('3W',today);
    
    dur := (NewDate - today) * 24 * 60 * 60000;
    
    
    message(format(dur));
    

    It will have it in days only.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • xavigepexavigepe Member Posts: 185
    Thanks so much. I think I will use a rutine for doing this. The idea was to specify the validity of a quote in a Dateformula field, for example 3M for three months, and when printing the quote show 3 months instead of 3M.

    Thanks for your help.
Sign In or Register to comment.