this is very easy with a custom function like: http://www.briandunning.com/cf/345
The calculation will be simply:
NextDayNameDate ( Orders::date_complete ; Customers::day_Name )
But it can be made even if you haven't an Advanced version of FM... let me know.
Thanks Ray, that looks exactly what I need.
I don't have advanced however. How do I add this custom function in Pro10.:smileyhappy:
you cannot insert a CF into your DB w/o Advanced.
But there is a solution anyway... only it needs two fields:
1) create a calculation repeating field ( result date and name:r_dates ) with 7 reps and calc:
d = Extend ( date_complete ) + Get ( CalculationRepetitionNumber ) ;
Extend ( Customers::day_Name ) = DayName ( d ) ; d
This field doesn't need to be on the layout
2) define your dispatch_date as a calculation field ( result date ) with the calc:
List( r_dates )
I can name that tune in one note. Ha ha. I mean, it can be done in one calculation also without need of custom function. Resource-wise, I'm unsure which would be the fastest
Let ( [
dayNow = DayOfWeek ( Date_Complete ) ;
dow = 1 + Div ( Position ("Sunday___Monday___Tuesday__WednesdayThursday_Friday___Saturday_" ; DayName ; 1 ; 1 ) ; 9 ) ;
days = Case ( dayNow < dow ; dow - dayNow ; 7 - dayNow + dow )
Date_Complete + days
But your calculation works only on English platforms ( you hard-coded the day's mames ).
I'm sure that you can do better things.
Fantastic, exactly what I needed to do. Fit perfectly into my solution.
P.S. Only using solution in Australia and New Zealand so English is fine.
I have played with your solution too and got it working well as you described with the two fields. As I only require English I have gone with Stella's solution in this case. I am grateful for your help and did learn a bit with your help.