"unable to find subWeek" function" for a date variable?

"unable to find subWeek" function" for a date variable?

Hi Zoho,

I have a date field on the form, I've crated a dates list based on the date with addYear / addMonth.

Now I'd like to insert records into another form, based on these dates.

I have scripted:

    insert into Flags_n_Alerts
    [
        LoanCompReq_ID = input.ID
        Popup_Date = EachReportDate .subWeek(3)
Actual_Date = EachReportDate
        Project_Name = input.Project_Name
            ]


Both Popup_Date and Actual_Date are date fields.
On other cases, Actual_Date gets date variables and date variable with "subWeek" function with no problem.

On one form - Loan_Valuations - I get an error saying "unable to find subWeek function"...
I also get error for trying to use subDay etc. 
The  EachReportDate value itself is fine, since inserting it to the Actual_Date field does no cause any error (and trying to insert  EachReportDate.subWeek into Actual_Date  does cause an error)

Adding "toDate()" at  EachReportDate.toDate().subWeek helped to take down the error and save the script, but now when I submit the form I get an error saying :

Error details:
Error in executing On Edit - On Successscript.
Error.
Error in executing Iterate List task.
Error in executing Add Record task.
Unable to add the value {0} to the field {1}.


Please help


Ravid