DateFormula fields

blikensblikens Member Posts: 10
edited 2001-05-24 in Navision Financials
I'm trying to populate some new fields in a table with processing only report. One of the fields was set up as DateFormula type. When I try to compile my report with a line such as

Customer."InState Ship Lead" := -5D ;

I get an error message that there is something wrong with my constant. I can manual enter -5D into the table without a problem. Any suggestions?

Comments

  • John_TegelaarJohn_Tegelaar Member Posts: 159
    The data for the dateformula should be entered as text, so surround it with single quotes and it should do what you want.

    John
  • blikensblikens Member Posts: 10
    I've tried the single quote. I get a different error referencing type conversion. If I create a test report of the processing only type, and put the following line of code in the OnPreDataItem() trigger:

    Instate := -5D ; (where Instate is a global variable
    of the dateformula type

    I get an error stating there is something wrong with my constant.
    If I enclose the -5D in single quotes, I get an error referencing type conversion.
  • trifftriff Member Posts: 23
    Yes you are right it does not work how you would expect it to.

    The best way to set the value of a dateformular is with the Evaluate function.

    i.e.
    EVALUATE(da,'-5d');

    Paul Baxter
  • blikensblikens Member Posts: 10
    Thank you kindly for your assistance. The EVALUATE command suggestion worked perfectly and will help me resolve issues with several other objects I'm working on. THANKS!!!
  • PrebenRasmussenPrebenRasmussen Member Posts: 137
    Do remember that the SQL-option does not support DateFormula as datatype. Instead change the field to Code (i.e. length 20) and set the property DateFormula to Yes.
  • blikensblikens Member Posts: 10
    Thanks for the extra help. It should come in handy as we are in the process of trying to decide how to make some of our Navision database accessible to our customers. One of my coworkers wants to open up our firewall and let customers access an onsite webserver, but I have my reservations. I guess I should pursue this in another topic, though. Thanks again.

    Bill
Sign In or Register to comment.