Russ' Do It Yourself Home Workshop

Finding Fixes to Just About Anything and Everything

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

Posted by Russell Wright on March 6, 2013

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

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 )

Facebook photo

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

Connecting to %s

 
%d bloggers like this: