Kentico BizFormItem

Theodoulos Iacovou asked on March 10, 2020 13:45

This code checks when the FormInserted is not empty then delete the records from the ContactUs form.

I want to change it and to do it when the FormInserted(date) is greater than on year then to delete the records from the ContactUs form.

ObjectQuery<BizFormItem> data = BizFormItemProvider.GetItems(formClassName).WhereNotEmpty("FormInserted");

Correct Answer

Brenden Kehren answered on March 10, 2020 14:11

Then you'd update your where clause to something like this:

.Where("FormInserted < DATEADD(day, -365, GETDATE())")

1 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.