There is a new datatype in Attain, DateFormula. You cannot compile a Dataport which references a data field of type DateFormula. This would include fields such as the ones that cause Due Dates or Discount Dates to be calculated (such as those in Table 3, Payment Terms). I know of no workaround at this time. Dave Studebaker firstname.lastname@example.org Liberty Grove Software A Navision Services Partner
A quick workaround is assigning the value of the DateFormula field to a text variable. Remember to do it on both import and export, and have the dataports “Dataport Fields” use these variables. Works for me… /Soren
It seems that Navision left out several things when they implemented the DateFormula datatype. You can’t test a date formula against a text string (e.g. DateFormulaVariable = ‘’) - you get a type conversion error. As a work around you can format the DateFormula variable and then test it.
Daves wrote: There is a new datatype in Attain, DateFormula.
Well… the datatype Dateformula already exists in Navision 2.6 (i cannot remember if in previous ones also). You can export a Dateformula in a dataport also by using as dataportfield FORMAT(Dateformulavariable) instead of just the dateformulavariable. Regards from L.A. – Alfonso Pertierra email@example.com Spain Western Computer Los Angeles, California
You can export a Dateformula in a dataport also by using as dataportfield FORMAT(Dateformulavariable) instead of just the dateformulavariable.
Yes, but the general idea of dataports is like exporting and importing data. And using the FORMAT command in the sourceexpression of a dataport field doesn’t work when trying to import /Soren
Hi, I am an experienced developer but new to Navision. I’m using Navision Attain (GB 3.01.A) and unfortunately, I have a problem… Has anyone managed to set the value of a dateformula field in an import dataport? Or just in C/AL code? I can’t get this to work. I have tried Soren’s suggestion, to import into a temp. text var. This works, but only gets you the value into the temp. variable. When you try to set the value of the field to the temp var (or anything else) you get compile errors. For Example : “DataFormulaField” := myTempTextVar; “DataFormulaField” := ‘1W’; “Items”.“Reorder Cycle” := ‘1W’; These (or any combination of this kind of thing which I try) just gets me compile errors. Can anyone help me? Much appreciated, Duncan Lock
To test a date formula, you must use FORMAT command: IF FORMAT(DateFormulaVariable) = ‘’ THEN and to set the value, you must use the EVALUATE command: EVALUATE(DateFormulaVariable,’<1W>’); < and > is multi language enabling, so it works i another contries. If you use < and > in date formula you must write the date formular in english.