You could try this.
Declare a Variable if Type Integer eg. IntLeadTime
Then change the original Evaluate to this
EVALUATE(IntLeadTime,FORMAT(USItem."Lead Time Calculation")+'+4D')
Or You could just do
EVALUATE(IntLeadTime,FORMAT(LeadTime))
A date formula does not convert to an integer. What integer would you want 'CM + 4D' to convert to? The "value" of a date formula depends on the specific date the formula is applied to. You could pick an arbitrary date (e.g. TODAY, WORKDATE), use CALCDATE, and then subtract the original date from the result to arrive at an integer number of days. But the result will be dependent upon the arbitrary date you pick.
The date calculation formula can contain a maximum of 20 characters, both numbers and letters. You can use the following letters, which are abbreviations for time specifications:
C - Current
D - Day(s)
W - Week(s)
M - Month(s)
Q - Quarter(s)
Y - Year(s)
You can construct a date formula in three ways:
1. Current plus a time unit. For example:
CW - Current Week
CM - Current Month
2. A number and a time unit. A number cannot be larger than 9999. For example:
10D - 10 days from today
2W - 2 weeks from today
3. A time unit and a number. For example:
D10 - The next 10th day of a month
WD4 - The next 4th day of a week (Thursday)
You can combine these three forms as needed. For example:
CM+10D - Current Month +10 days
You can use a minus sign to indicate a date in the past. For example:
You can always do arithmetic operations like LeadTime := LeadTime + 4. Also You can find difference like
IntegerValue := CALCDATE(YourDateFormula,TODAY) - TODAY
IF CompanyInformation."Country Code" = 'MX' THEN
EVALUATE(LeadTime,FORMAT(USItem."Lead Time Calculation")+'+4D')
ELSE
LeadTime:=USItem."Lead Time Calculation";
This way I get for example 14D + 4D
I tried the code LeadTime:=USItem."Lead Time Calculation"+4;
but I get the error message I previously said.
OK, i think i did not understood what you asked
In this case you can do like this
EVALUATE(LeadTime,FORMAT(USItem."Lead Time Calculation") + STRSUBSTNO(TextConstant,YourIntegerNumber))
TextConstant in English must be +%1D, in other language it can be differ. System instead of %1 will place YourIntegerNumber
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
You could try this.
Declare a Variable if Type Integer eg. IntLeadTime
Then change the original Evaluate to this
EVALUATE(IntLeadTime,FORMAT(USItem."Lead Time Calculation")+'+4D')
Or You could just do
EVALUATE(IntLeadTime,FORMAT(LeadTime))
Well then If i can't convert dateformula to integer. How can I add more days to initial value?
EVALUATE(LeadTime,FORMAT(USItem."Lead Time Calculation")+'+4D')
This is the line I have. So then I will prefer to add 4 days to inial value.
http://www.BiloBeauty.com
http://www.autismspeaks.org
IntegerValue := CALCDATE(YourDateFormula,TODAY) - TODAY
I am getting the following error message:
Type conversion is not possible because 1 of the operators contains an invalid type
DateFormula + Integer
André
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
IF CompanyInformation."Country Code" = 'MX' THEN
EVALUATE(LeadTime,FORMAT(USItem."Lead Time Calculation")+'+4D')
ELSE
LeadTime:=USItem."Lead Time Calculation";
This way I get for example 14D + 4D
I tried the code LeadTime:=USItem."Lead Time Calculation"+4;
but I get the error message I previously said.
LeadTime: DateFormula
Thank you a lot
In this case you can do like this
EVALUATE(LeadTime,FORMAT(USItem."Lead Time Calculation") + STRSUBSTNO(TextConstant,YourIntegerNumber))
TextConstant in English must be +%1D, in other language it can be differ. System instead of %1 will place YourIntegerNumber