Calcdate language independent using variables

helmhelm Member Posts: 46
edited 2007-07-27 in Navision Financials
Hello all experts

I'm trying to get a calcdatefunction that is using a varible language independent in a Navision Financials 2.60 program.

I've tried the following ways:
EVALUATE(InvPeriodDF,Cust."Invoice period");
AgrHdr."Next invoice date" := CALCDATE(InvPeriodDF,AgrHdr."Next invoice date");
where InvPeriodDF is a DateFormat and Cust."Invoice period" only contains e.g. 1Y or 1M.

and
AgrHdr."Next invoice date" := CALCDATE('<Cust."Invoice period">',AgrHdr."Next invoice date");
Both produce the same runtime error where the program wants the swedish letter in the date expression. Am i trying the impossible here or have I missed some way to do this. :-k

Comments

  • krikikriki Member, Moderator Posts: 9,112
    Well, it will work if you change the language in English, it will work. But I have the idea your 2.60 is singlelanguage (like in most countries).
    In this case you need to use Swedish characters.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • David_CoxDavid_Cox Member Posts: 509
    If this is customisation and you want the formula language independant, then could you not use a "Number of Days" Field (Integer) instead?

    I recently hardcoded '30D' in a report, which did not work in the French database, so I changed it Language Independant, to use Date + 30;

    Dave
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • plpconsultplpconsult Member Posts: 3
    Hi.

    You need to put pointy brackets around your dateformula like '<+1D>'

    This will work in all country databases.
    Senior Consultant
    PLP Consult
  • plpconsultplpconsult Member Posts: 3
    Sorry, I didn't spot your code in the first instance:
    '<Cust."Invoice period">'
    

    You have embedded all within the single quotes, i.e. you need to do this:
    '<' + Cust."Invoice period" + '>'
    
    Senior Consultant
    PLP Consult
  • plpconsultplpconsult Member Posts: 3
    Oh, and by the way, you need to format it like this:
    '<' + FORMAT(Cust."Invoice period") + '>'
    

    (I hope this is my last post for this issue :-# )
    Senior Consultant
    PLP Consult
Sign In or Register to comment.