25
Nov
12

Unsupported Expression in InfoPath 2010

 

This is a weird one.

Situation:

Going back to a SharePoint 2007 site formerly published with InfoPath 2007.  Downloaded the form template and made some changes.  When I went to re-publish I encountered an “unsupported expression” error.

image

The actual long message was as follows.

The following expression could not be parsed because of a syntax error or because it uses an undefined namespace prefix or unsupported function:  pc:DisplayName

image

This appeared to have been coming from one of the people pickers (circa 2007 variety) but copying the Xpath on each of them yielded no easily identifiable pc:DisplayName.

/my:myFields/my:EmployeeManager/my:Person/my:DisplayName

/my:myFields/my:EmployeeGroup/my:TerminatingEmployee/my:Person/my:DisplayName

I went back to the original template with no changes and it didn’t throw the same error during publishing.

I changed the Form type from Web Browser Form (InfoPath 2007) to InfoPath 2007 Filler Form and attempted publishing.  The error went away.

image

So, I changed it back to Web Browser Form (InfoPath 2007) again…the way it originally was.  The error stayed away and I published the form. 

However, after publishing, the error came back.  Sad smile  So I decided to look “under the covers.”

I saved the XSN as source files and looked within all the files.  I was able to find where the pc: schema infiltrated my form template.  Within view1.xsl I found the offending pc:DisplayName, and all the other related pc: references. 

image

I’m not sure how this made its way into the form template, as I never specifically made this change, nor do I know how one would force this. 

</xsl:if>

                                        <param NAME="ButtonFont" VALUE="Verdana,12,0,400,0,0,0"/>

                                        <param NAME="ButtonText" VALUE=""/>

                                        <param NAME="DisplayNameXPath" VALUE="pc:DisplayName"/>

                                        <param NAME="ObjectIdXPath" VALUE="pc:AccountId"/>

                                        <param NAME="ObjectTypeXPath" VALUE="pc:AccountType"/>

                                        <param NAME="SiteUrlXPath" VALUE="/Context/@siteUrl"/>

                                        <param NAME="SiteUrlDataSource" VALUE="Context"/>

                                        <param NAME="NewNodeTemplate" VALUE="&lt;pc:Person xmlns:pc=&quot;http://schemas.microsoft.com/office/infopath/2007/PartnerControls&quot;&gt;
    &lt;pc:DisplayName&gt;&lt;/pc:DisplayName&gt;
    &lt;pc:AccountId&gt;&lt;/pc:AccountId&gt;
    &lt;pc:AccountType&gt;&lt;/pc:AccountType&gt;
&lt;/pc:Person&gt;"/>

                                        <param NAME="BackgroundColor" VALUE="2147483653"/>

                                        <param NAME="MaxLines" VALUE="4"/>

                                        <param NAME="Direction" VALUE="0"/>

I did a simple “find and replace” on all the pc: occurrences with my: and saved and tested my work.  All appears to be okay.

Sure would be nice to know how this happens!

Advertisements

0 Responses to “Unsupported Expression in InfoPath 2010”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Asif Rehmani’s SharePoint Videos

SharePoint-Videos

Click to access a wealth of SharePoint videos

SharePoint Rx

SharePoint Rx Home

Categories

Posts by Date

November 2012
M T W T F S S
« Oct   Mar »
 1234
567891011
12131415161718
19202122232425
2627282930  
Support Wikipedia

%d bloggers like this: