Kentico doesn't update bizform after upgrade

Jaroslav Šebok asked on September 12, 2016 14:01

I have a custom web part containing one bizform which serves as a filter for UniGrid. I've migrated from kentico 7 to 8 and now the form doesn't update the data. For instance I try to tick one option in the field and then submit it and after page reload its back to default value also UniGrid stays as it is. What's even more interesting is if I do it on the page in version 7 and then refresh the page of version 8 it filters the UniGrid according to filter from version 7. I think it's because it takes the value from session or some cookie.

I commented out one line of code because the field FormMode isn't there anymore:

int formRecordId = ValidationHelper.GetInteger(dsFilterForm.Tables[0].Rows[0][0], 0);
//viewBiz.FormMode = FormModeEnum.Update;
viewBiz.ItemID = formRecordId;

I tried to comment out that line in the version 7 as well but the only thing that does is update filter form from database. UniGrid is filtered correctly (in ver. 7) even with this commented out.

I also tried to debug the program and examined the database traffic in SQL Server Profiler and found out that there's one operation which kentico 8 doesn't do after submit (or save):

exec sp_executesql N'UPDATE Form_CSOBL_FilterForm SET [FormInserted] = @FormInserted, [FormUpdated] = @FormUpdated, [UniGridID] = @UniGridID, [PageName] = @PageName, ... 

Can you provide any possible causes and solutions to this problem?

EDIT:

Also, the form displays this when I try to save the data: "An error occurred when saving data:"

EDIT 2:

Here is the event log for the bizform: http://pastebin.com/Y3qhzwqE

Recent Answers


Richard Sustek answered on September 12, 2016 15:55

I'm not entirely sure what you are doing, but the reason the FormModeEnum is not available is because the form automatically checks whether it should use Insert or Update mode based on a presence of forms primary key.

Can you try running:

viewBiz.ReloadData();

after you assign it with the ItemID? It should initialize the form and load values based on your configuration.

0 votesVote for this answer Mark as a Correct answer

Jaroslav Šebok answered on September 13, 2016 10:36

It does indeed update the form automatically however the problem of not saving the form data to the database persists.

Please take a look at http://pastebin.com/Y3qhzwqE

It fails to save the form in CMS.OnlineForms.BizForm.SaveDataInternal()

0 votesVote for this answer Mark as a Correct answer

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