Hi guys,
Thank you for attention to my problem. Let me simulate it on a very basic form that has only one string field and one validation rule that requires length to be not less that 10. So the field config looks like pic.1:
Then I test validation rule by using standard backend UI and I see the rule is working (pic.2):
Finally, I'm trying to create record using very simple code
BizFormInfo formObject = BizFormInfoProvider.GetBizFormInfo("myTestForm", SiteContext.CurrentSiteID);
DataClassInfo formClass = DataClassInfoProvider.GetDataClassInfo(formObject.FormClassID);
string className = formClass.ClassName;
ObjectQuery<BizFormItem> data = BizFormItemProvider.GetItems(className);
BizFormItem formRecord = BizFormItem.New(formClass.ClassName);
formRecord.SetValue("MyTestField", "tooShort");
formRecord.Insert();
And this code successfully submits a record with validation rule violated! That's what I see in form records database page, you may see "tooShort" string stored in DB (pic.3) :
What I really need, is to look, what that generic form page or bizform webpart does to validate data, but it is shipped with no source code. It looks like I need to call some method to manually validate data, but I it's not documented and I cannot find it.