I am trying to implement an “errors page” (a separate view) in InfoPath browser-enabled forms, because users often find it difficult to locate errors in multiple view and complex forms. An errors page may also facilitate more and better information/links to resources/guidance on errors than mouse over info allows for.I am extensively using referenced groups/fields, where a repeating group may be used in different views but for different purposes/to allow for a different functionality, as illustrated below.
VIEW 1 (used for the applicant company):
<my:CompanyGroup>
<my:CompanyTable>
<my:CompanyId></my:CompanyId>
<my:CompanyName></my:CompanyName>
<my:CompanyAddress></my:CompanyAddress>
<my:CompanyZip></my:CompanyZip>
… etc
</my:CompanyTable>
</my:CompanyGroup>
VIEW2 (used for partner companies):
<my:CompanyGroup2>
<my:CompanyTable> (reference repeating group of CompanyTable above)
<my:CompanyId></my:CompanyId>
<my:CompanyName></my:CompanyName>
<my:CompanyAddress></my:CompanyAddress>
<my:CompanyZip></my:CompanyZip>
… etc
</my:CompanyTable>
</my:CompanyGroup2>
I use the FormError properties to locate the errors, and display them in an errors list on the errors page, where I also want to indicate the particular view where the error occurs. However, these properties (Site.LocalName, Site.OuterXml.ToString) only allows me to identify the immediate node, and not the parent node (example: err.Site.LocalName on an error in CompanyZip only identifies the node name “CompanyZip”). Because the same node may occur in different referenced groups in different views, I am not able to guide the user to which view the error occurs (is it in View 1 or View 2?). So my question is, how do I traverse from the particular error object (e.g. CompanyZip) to its parent (first to CompanyTable, then to CompanyGroup)?