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).
You insert the custom list form like this.
The goal is to move this field down to the end of the form to get it out of the way.
You select the row and cut it for repositioning to the end of the form.
Now you’ve got it at the bottom of your form.
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.
Bind the Data field to the column and format it as a Text Box.
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.
With your text box selected, find the text property and change it from @Fieldname to $Parametername.
If you don’t get the name correct, you’ll see an error displayed instead of your form.
If you want to hide the field completely on the form to eliminate any human intervention, add class=ms-hidden to the table row.
Leave a Reply