Great Day All,
How to convert a dateformula field to text or code.
For eg:
1. I am having a dateformula field of value 12M. I want the output as
12 Months.
2. If the value of the dateformula field is 12D. I want the output as
12 Days.
3. If the value of the dateformula field is 12Y. I want the output as
12 Years.
can any one help me.
0
Comments
Good luck!
Jan Hoek
Product Developer
Mprise Products B.V.
Something a lot of people seem to forget (even the Navision W1-developers).
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Using format function i have converted my dateformula field to string. Then, after that how to proceed further to reach my output what i want?
can you guide me....
-12D = minus 12 days
+4M = plus 4 months
30D = 30 days
2W = 2 weeks
CM+10D = Current month plus 10 days
CM+1M = Current month plus one month
CQ+1M+20D=Current quarter plus one month plus 20 days
CW+1W = Current week plus one week
D15 = On the 15th of each month
M12 = on the 12th month
So we have to do a lot. I will not write all code (I'll also use some pseudocode).
And I didn't test anything, but at least you will have a good start
Function "GetToken":
This function gets a substring and returns it.
The substring can exist of 1 or more chars. The chars must belong together.
Tokens can be:
CM,CQ,CW,-,+,1,12,123,D,M,Y,Q,D15,D1,M12
When you have the token, the chars must be removed from txtString.
Some code:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!