Prashant, When we were trying to set the value of any Infopath form field that has some rules or data validation from FormServer.aspx.cs page, the same Infopath fatal error we recieved.
We fixed this issue using jquery.
1. Take a Textbox field on Infopath form and set its screentip lets say "xyz".
2. Write a change event of this field.
public void xyz_Changed(object sender, XmlEventArgs e)
{
if (e.NewValue != string.Empty)
{
//set the value of required field
}
}
3. In that change event, set the value of the other field to "1" which has configured some rules.
4. Now on button click of web part, right a Javascript function:
function fnSetData()
{
var temp = ($('input[title="xyz"]'));
clientDataTxt.val("1");
clientDataTxt.blur();
}
Please try this approach. This approach fixed our issue.