We're using a fast formula to pull the hours an employee worked from an element. The element stores the hours in an array, I built this loop to add the hours in the array to the TOTAL_REG variable so we can use it to calculate the accrual.
I = 1
change_contexts(DATE_EARNED= l_effective_date)
WHILE (YH_REGULAR_TIME_ENTRY_HOURS_ENTRY_VALUE.EXISTS(I))Loop
(REG_HOURS = ( YH_REGULAR_TIME_ENTRY_HOURS_ENTRY_VALUE [I])
TOTAL_REG = TOTAL_REG + REG_HOURS
I = I+1
)
The code compiles just fine but when I run the accrual the system throws this error, 'Context DATE_EARNED was not set when used at line 57 of formula AC_NYC MPL ACCRUAL' So I tried to add the context but then I get a syntax error at the GET_CONTEXT line
I = 1
change_contexts(DATE_EARNED= l_effective_date)
WHILE (YH_REGULAR_TIME_ENTRY_HOURS_ENTRY_VALUE.EXISTS(I))Loop
(REG_HOURS = ( YH_REGULAR_TIME_ENTRY_HOURS_ENTRY_VALUE [I])
TOTAL_REG = TOTAL_REG + REG_HOURS
I = I+1
GET_CONTEXT(DATE_EARNED, '4712/12/31 00:00:00' (date))
)