06
Mar
13

Reordering and Hiding Fields and Passing URL Parameters on a New Item Form in SharePoint 2010

Let’s say you are creating a new item form using SPD 2010 and you don’t have InfoPath because the company didn’t purchase the Enterprise version of SharePoint.  Your goal is to pass a URL parameter to the new item form from some other part of the SharePoint application you are building.  Perhaps the link that contains the URL parameter was created by a workflow (hint hint).

image

You insert the custom list form like this.

image

The goal is to move this field down to the end of the form to get it out of the way.

image

You select the row and cut it for repositioning to the end of the form.

image

Now you’ve got it at the bottom of your form.

image

Now you test your form (before adding the parameter to pass) and it "works" but it doesn’t correctly save the data in the field you relocated.

The correct way to do this is to delete the field row at the top, add a new row at the bottom and insert a new text field and bind it to the column.

image

Bind the Data field to the column and format it as a Text Box.

image

Under Options, select Parameters and add a New Parameter, giving it a name that is memorable for you.  Then, bind it to the Query String variable of your choice.

image

With your text box selected, find the text property and change it from @Fieldname to $Parametername.

image

If you don’t get the name correct, you’ll see an error displayed instead of your form.

image

If you want to hide the field completely on the form to eliminate any human intervention, add class=ms-hidden to the table row.

image

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!

21
Nov
12

InfoPath Blog Silent?

Is it just me, or has anyone noticed the InfoPath team blog at http://blogs.msdn.com/b/infopath/ has been silent for the last year and a half?  Did they move it somewhere else when I wasn’t looking?  Or, did I finally look up for a minute, only to find the world has passed me by…again?

21
Nov
12

Site Navigation Settings Missing in SharePoint 2007 Using IE9

So let’s say you are using IE9 and you go to the Site Navigation Settings page on a 2007 SharePoint site and see this:

image

And you scratch you head and wonder, “Where are all my navigation settings?”  Perhaps you did this many moons ago and you think it’s just old age setting in.  But a little Googling indicates you aren’t going crazy (or senile) and there’s some JavaScript issue with the page.

Try this.  Start IE9 without any add-ons by executing

iexplore –extoff

Then, navigate to the same page and voilà, your navigation editing area appears!

image

This must be due to some malcontent add-on.

Enabling and disabling add-ons and refreshing your page brings you to NameCtrl Class being the add-on that seems to be causing the problem.  Disabling this add-on fixes the issue…at least it did for me!

image

 

Search terms:

NameCtrl Class Microsoft Corporation

Add-on issues with IE9 and SharePoint 2007 navigation

10
Oct
12

Microsoft Project 2010 Sync with SharePoint 2010–Sorting It Out!

The sync with Project 2010 is great, but there are some "issues" you might run in to.  One of these is sorting the SharePoint task list so it matches up with Project.  I’ve found the key to this is to add the WBS (Work Breakdown Structure) column to the sync columns and sort by the WBS column.  For those not familiar with WBS, it is a hierarchical numbering scheme used for tasks in a project plan, similar to legal numbering of paragraphs, i.e. 1, 1.1, 1.1.1, 1.1.2, 2, 2.1, 2.2, 2.2.1, 2.2.2, etc.  Using the WBS as a sort field allows you to keep the tasks in the project plan order.

Add a simple text column called WBS to your SharePoint task list.

image

Using the Sync feature on Project Professional 2010, add the WBS column to the list of sync’d fields.

image

image

Sync your project to SharePoint (that can have its own set of issues).

Add the column as a primary sort column to your view.

image

Voilà!  You are sorted by WBS!

image

As you drill through the tasks, you’ll notice they are all in WBS order.

image

If you create a view that excludes folders, you’ll see something like this.  The important thing to note is, since this view is excluding folders, the summary tasks are not shown, as they are implemented as folders in SharePoint.

image

02
Oct
12

Launch form in a dialog doesn’t work correctly when displaying a list in datasheet view

This was driving me nuts.  I had a custom list in SharePoint 2010 and I wanted the new item form to NOT open in a dialog.  No matter what I did, it kept opening in a dialog.

image

Then I stumbled upon what was causing my issue!  Whenever the list was displayed in a datasheet view (which was my default), the new item form would always display in a modal dialog.

List displayed in datasheet view.

image

 

 

 

 

 

 

 

 

 

 

Create a new entry…

 

image

 

…and modal dialog is displayed (notice no master page "chrome”).

 

image

 

Change to standard view…

 

image

 

…and the form is opened up in single page mode (notice master page “chrome”).

 

image

What’s up with that?

An interesting thing to note is this problem also exists with Calendar lists.  If you display a calendar list in anything other than a normal list view, the “Launch forms in a dialog” will not be respected when set to “No.” 

Again, if we set “Launch forms in a dialog” to “no” and view the calendar in “Calendar” view…

 

image

 

…and attempt to create a new event while in this view…

 

image

 

…the form opens in a dialog.

 

image

 

If we change to the “All Events” view and attempt the same thing…

 

image

 

The form is opened in a new page (no dialog).

 

image

 

Perhaps this is the designed behavior, but if it is, I would recommend renaming the option to “Launch forms in a dialog when showing items in standard view.”

The description of the option would lead one to believe there might be times when a dialog would not be displayed when you would expect it to be displayed…not the other way around.

 

image

 

I guess I shouldn’t be disappointed when I get “free” dialog forms.

 

Keywords:

Launch form in a dialog broken

Launch form in a dialog doesn’t work for custom list

List view affects dialog form

30
Jul
12

Mystery Meat Navigation in SharePoint Designer 2010

One of my favorite topics is how Microsoft have forgotten to design user interfaces over the years, even though they published some books early on which defined the correct way to create a UI.

When I really feel “in the mood,” I go back and browse Vincent Flanders’ Web Pages That Suck site.  I’m constantly reminded from MS about some of their stupid interface design, usually executed for the sake of marketing flair, is not necessarily confined only to web UIs.  It’s prevalent throughout all their products, if one simply looks for five minutes.

Here’s one that always gets me, and it’s possible I’ve written about it in the past. 

This is an innocent tool ribbon (don’t get me started…) in SPD 2010 that has three items in a group called Manage, that don’t operate the same.  Can you tell, “which one of these things is not like the others…which one of these things just doesn’t belong?”

image

I’ll give you a hint.  It’s the one in the middle, which is an action button, while the ones on the outside are push buttons. 

image

This is what happens when programmers grow up without the benefit of ever having used a pushbutton car radio (not exactly, but you get the point).

image




Asif Rehmani’s SharePoint Videos

SharePoint-Videos

Click to access a wealth of SharePoint videos

SharePoint Rx

SharePoint Rx Home

Categories

Posts by Date

June 2013
M T W T F S S
« Mar    
 12
3456789
10111213141516
17181920212223
24252627282930
Support Wikipedia

Follow

Get every new post delivered to your Inbox.