AnsweredAssumed Answered

Script Loop?

Question asked by GJBDJC on Oct 29, 2015
Latest reply on Oct 29, 2015 by coherentkris

Hello all,

 

I am trying to create a script loop that will set 20 date fields with dates.  These fields must skip weekend dates.

So I have 20 date fields named: gToday, gDate + 1, gDate + 2, g Date + 3... and so on.

 

My script reads as follows:

 

Set Variable [$Date; Value: Get(CurrentDate)]

Set Field [Global Fields::gToday; $Date]

Loop

    Set Variable [$Day; Value: $Day + 1]

    Exit Loop If [$Day = 20]

    Set Variable [$Name; Value: $Name + 1]

    Set Variable [$Date; Value:Let (day = day of week ($Date) ; $Date + Case (day = 7; 1 ;day = 6; 1 ; 2 ; 0 )) + 1]

    Set Field [$Name; $Date]

End Loop

 

Does not work????? Thoughts???

Outcomes