Link to home
Start Free TrialLog in
Avatar of kriskyk
kriskyk

asked on

Passing SharePoint Query Paramters to a Form

I'm able to pass the query parameter successfully to the field however when the item is saved the record is not being saved to the list. What's interesting is that if I manually override the passed value by typing into the field on the form and then clicking save, the record is saved to the list .

We have a working example of this on the same site for a different list that we created about a year ago and does not have this issue.


Original Code Provided when a new form was created for the list in SPD:
<SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="New" FieldName="AttachmentsID" __designer:bind="{ddwrt:DataBind('i',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@AttachmentsID')}"/>
<SharePoint:FieldDescription runat="server" id="ff1description{$Pos}" FieldName="AttachmentsID" ControlMode="New"/>


Removed the above code and replaced with the following:                                                            
<asp:TextBox runat="server" id="ff1{$Pos}" Name="FileName" Text="{$AttachmentsID}" Value="{@AttachmentsID}" __designer:bind="{ddwrt:DataBind('i',concat('ff1',$Pos),'Text','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@AttachmentsID')}" Width="100px" Height="20px" BorderWidth="0" />
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Hi kriskyk,

Just want to make couple of things clear, have you followed the process as described in this article: http://www.geekswithblogs.net/SoYouKnow/archive/2009/10/29/setting-sharepoint-form-fields-using-query-string-variables-without-using.aspx?

If yes, then let me know the SharePoint version you are using. I was also wondering that this technique is pretty old and maybe they have changed it so that only certain pre-configured/allowed querystrings canbe processed in this fashion.

Regards,
Chinmay.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.