Question

Kirchh on Fri, 22 Jul 2011 20:41:55


If I add a lookup column to a list and specify that it is NOT required, a choice appears at the top of the drop-down list for that column with the value "(None)". However, when I select that choice, and then attempt to save the item, I receive the following error message in a dialog:

The list item could not be inserted or updated because invalid lookup values were found for the following field(s) in the list: [MyLookupFieldName].

I receive the same message if I completely clear the field (which is not easy to do!).

Anyone else getting this, is it a known bug, and is there a decent workaround?



Sponsored



Replies

Mayur Joshi on Fri, 22 Jul 2011 21:07:29


I just tried that and it works perfectly well for me. Can you list down the configuration for the look up column. 

Steve.Curran MVP on Sat, 23 Jul 2011 03:43:17


Make sure the "Enforce Unique Values" and "Enforce Relationship" options are turned off.

Kirchh on Sat, 23 Jul 2011 16:21:39


Make sure the "Enforce Unique Values" and "Enforce Relationship" options are turned off.
Blog | SharePoint Field Notes Dev Tool | ClassMaster

The error does not occur when those settings are off, but I want to enforce the relationship. Why wouldn't the relationship be enforceable if the column is not required? I don't want items deleted that are referenced by other lists.

Steve.Curran MVP on Sat, 23 Jul 2011 18:47:22


The relationship is enforceable if it is not required. Selecting (None) will work. However, just like the error states you have some invalid data in your lookup column. Not sure how you are getting this error. Maybe you can shed some light on how this lookup column was created. Is it a custom lookup column, or migrated from SP2007? Has the list schema been modified by code?

Kirchh on Sat, 23 Jul 2011 19:02:10


The relationship is enforceable if it is not required. Selecting (None) will work. However, just like the error states you have some invalid data in your lookup column. Not sure how you are getting this error. Maybe you can shed some light on how this lookup column was created. Is it a custom lookup column, or migrated from SP2007? Has the list schema been modified by code?
Blog | SharePoint Field Notes Dev Tool | ClassMaster


Selecting (None) does not work if the relationship is enforced. I created a new custom list from scratch and added a single lookup column to it. There is no migration and no schema manipulation of any sort. The column is not set as required.

If restrict delete is asserted, I get the error on save when selecting (None) for the column's value. If I turn off the relationship enforcement, I do not get an error when selecting (None) and saving the item.

Steve.Curran MVP on Sat, 23 Jul 2011 20:57:43


Are you still trying to connect to the original lookup list?

"The list item could not be inserted or updated because invalid lookup values were found for the following field(s) in the list: [MyLookupFieldName]."

Try using an out of the box list like announcments. Do you still get the same behavior?

Kirchh on Sat, 23 Jul 2011 22:08:55


Are you still trying to connect to the original lookup list?

"The list item could not be inserted or updated because invalid lookup values were found for the following field(s) in the list: [MyLookupFieldName]."

Try using an out of the box list like announcments. Do you still get the same behavior?


Blog | SharePoint Field Notes Dev Tool | ClassMaster


I tried using a lookup column from a list created as an Announcements list and I did not encounter the same error. I then created a new custom list from scratch to use as the source of the lookup column, and I did not encounter the error. So now I have two lists that appear to be identically created and configured (as best I can tell), and one produces the error and the other doesn't. I am not sufficiently expert to know how to view any definitional language that might be stored (CAML?) so that I could compare the two to identify any differences.

Something interesting/odd I noticed when using the edit form for the list that contains these lookup columns: The column that is triggering the error has a strangely wide entry field (in this case, it's a state code that is only two characters), and the graphic for the pulldown box is different from that of the second lookup column that does not produce the error (note the size of the triangle and the shading on the button). This graphical difference is consistent for all the lookup columns that do and do not generate the error:

 Appreciate all the assistance with this!

Steve.Curran MVP on Sat, 23 Jul 2011 22:21:09


Can you verify if the State lookup list is an External List?

Kirchh on Sat, 23 Jul 2011 22:33:32


No, the State lookup list is a custom list I created from scratch within the same site. It is becoming clear that there is some essential difference between that list (and the others that are triggering this same behavior) and the ones I just created for testing, but I am unsure how to identify the attribute that is responsible. Again, I appreciate the troubleshooting help.

Does the difference in the field graphic mean anything to anyone?

Kirchh on Mon, 25 Jul 2011 18:29:57


Well, I have discovered something interesting. When the list that the lookup column refers to has fewer than 20 items in it, no error is thrown when selecting (None), and the graphical appearance of the input control is as shown for the Country field in the screenshot in my earlier post (i.e., short-ish). However, when there are 20 or more items in that list (and thus 20 or more choices in the pulldown), the error under discussion is thrown when (None) is selected, and the field's graphical appearance matches that of the State field in the screenshot (longer, different graphic for the button with down-arrow).

Here's a screenshot of the same edit dialog as above, except now the Country list has 20 items in it, where before it had fewer than 20:

 A look at the HTML reveals that the dropdown is being defined differently in the <20 choices case and the >=20 choices case. Perhaps the returned value (which, I gather, should be a zero when (None) is selected) is of the wrong type or is otherwise different (and incorrect) in some respect, leading to the error in the >=20 choices case.

Can someone verify this behavior, and might someone from Microsoft weigh in on this?

Steve.Curran MVP on Mon, 25 Jul 2011 20:25:27


Appears to be a bug. Confirmed on my end. However, it works with Office 2010 files. Go figure.

Yassar on Tue, 26 Jul 2011 20:03:51


Hello All,

 

I am having the same issue and wondering if MS is aware of the issue or not. Is there any workaround instead of unchecking Enforce relationship behavior ?

Thanks,

Yassar

Yassar on Mon, 08 Aug 2011 09:50:42


Hello All,

I have opened a ticket with MS and they confirmed it is a "Bug". The case is still open and will update this post once I hear from them.

 

Kirchh on Tue, 06 Sep 2011 21:33:04


Yassar (or anyone) - any update on the status of this bug ticket?

Thanks.

--Daniel

John Mongell on Tue, 11 Oct 2011 15:04:48


I have also ran into this issue. SP Foundation in unpatched RTM version 14.0.4763.1000

Is there a CU that addresses this issue?

 Any movement?

Thanks, JohnnyJM


Kirchh on Sun, 30 Oct 2011 20:27:06


Any updates at all on this bug, reported to MS almost a quarter of a year ago?

Kirchh on Mon, 14 Nov 2011 18:14:12


Any updates at all on this bug, reported to MS over a quarter of a year ago?

kirkvanslyke on Mon, 21 Nov 2011 21:17:30


Just ran into this problem today. Here's an interesting link about the topic with a workaround that someone came up with. Unfortunately, it's not a Microsoft fix, so doubt I'll get my company to implement. It would appear that with the AJAX list, something special needs to be done to propely handle the parentheses characters in the '(none)' default entry. Somebody at Microsoft missed that one!

http://sharepointegg.blogspot.com/2010/10/fixing-sharepoint-2010-lookup-drop-down.html

 

Kirchh on Mon, 06 Feb 2012 13:18:24


To Sjoukje Zaal -

Please don't propose half-year-old comments as answers, especially when that specific poster subsequently wrote, "Appears to be a bug. Confirmed on my end."

The way to get your "Answered" numbers up  is to actually solve problems, not propose old posts as answers and hope no one notices.

There's been an open bug ticket with MS on this issue since at least August. Any updates, or does Microsoft continue to not care about SharePoint developers?

Andreas Lemarcq on Thu, 05 Apr 2012 14:11:24


Here you can find a simple work-arround using jQuery and SPServices: http://spservices.codeplex.com/wikipage?title=%24%28%29.SPServices.SPComplexToSimpleDropdown

TePartire on Mon, 06 Aug 2012 10:44:24


hello!, i fixed this problem using an event receiver, the problem is that when internet explorer renders the "Input Ajax" control (for more than 20 items) and you select (None), the value "0" is sent, then you have to modify the value to "" in the "ItemAdding" event like this

if (properties.AfterProperties["internalLookupColumnName"].ToString() == "0")

{
               properties.AfterProperties["internalLookupColumnName"] = "";
}

Note: just to remember the scenario...

1) Lookup field with more than 20 items

2) Cascade delete relationshipdeletebehavior

3) Using internet explorer (uses the ajax input instead of the dropdown list)

i hope this helps :)

hasta la vista! :D

Heath Anderson on Tue, 18 Sep 2012 17:45:58


Microsoft has released a hotfix that is intended to resolve this issue:

http://support.microsoft.com/kb/2687375

Note...the KB article makes reference to an additional step required after applying the hotfix:

After you apply the hotfix package, you must create the following flag in the NewForm.aspx page and in the EditForm.aspx page by using SharePoint Designer: 
<UseStandardControl xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">true</UseStandardControl>

Nicholasd1980 on Tue, 09 Oct 2012 01:33:56


Hello,

I've applied the hot fix and want to apply the SharePoint Designer flag above.

Does it matter where in the NewForm and EditForm aspx files you place the above flag? I entered it into the first <WebPart> element (like below) but I still get the lookup column error.

(I presume it is the NewForm and EditForm of the custom list which contains the lookup field that I add this to?)

Thanks!


Nicholas Demos


Nicholasd1980 on Tue, 09 Oct 2012 03:21:35


I managed to resolve my issue and no longer get the lookup list error.

As it turns out, the above flag was entered into the correct position afterall, but I had installed the incorrect hotfix version:

On the hotfix request page, I installed the hotfix for Microsoft SharePoint Server 2010, as this is what version I am running.

Installing the version for SharePoint Foundation 2010 instead fixed the issue.

Can I propose my answer as the solution to my own question?! ;)

Thanks

IN2_slavens on Tue, 23 Oct 2012 14:54:20


Hello Nicholasd1980,

My colleague (SP admin) has applied both patches, as we're running server edition same as you do. In EditForm.aspx and NewForm.aspx there are no <webpart> elements so I'm unsure where should I fit <UseStandardControl> element. I have tried placing it in <asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server"> but I had no luck in results.

Do you have any idea how could I make it work?

Thank you!


EDIT: I have also tried to place <UseStandardControl> element in every <asp:Content> element in aforementioned pages.

Nicholasd1980 on Wed, 24 Oct 2012 00:05:40


Hello IN2_slavens,

I'm not sure how there cannot be a <WebPart> element within your NewForm and EditForm pages - the actual form parts themselves on these pages (i.e. the collection of textboxes and input fields) are constructed using a WebPart element. Looking at the image in my post above, you can clearly see the <WebPart> element within which I place the <UseStandardControl> tag.

Are you certain there is no <WebPart> element on your forms? I fail to understand how they could work otherwise? Are these standard NewForm and EditForm pages, or have you customised them yourself, say using Designer or InfoPath?

I don't think the <UseStandardControl> tag will work unless it's placed within a WebPart.


Nicholas Demos


IN2_slavens on Wed, 24 Oct 2012 08:44:23


Nicholasd1980,

Yes, this page is cutomized using SPD, but it's the exact copy of the original with some added JavaScript. I can confirm that there is no <webpart> element inside. Just in case I'm including the entire NewFormModified.aspx here:

<%@ Page language="C#" MasterPageFile="~masterurl/default.master"    Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full"  %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
	<SharePoint:ListFormPageTitle runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
	<span class="die">
	<SharePoint:ListProperty Property="LinkTitle" runat="server" id="ID_LinkTitle"/>: </span>
	<SharePoint:ListItemProperty id="ID_ItemProperty" maxlength="40" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server">
	<img src="/_layouts/images/blank.gif" width='1' height='1' alt="" />
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server" >
	<SharePoint:UIVersionedContent UIVersion="4" runat="server">
	<ContentTemplate>
				<div class="ms-quicklaunchouter">
				<div class="ms-quickLaunch">
				<Sharepoint:UIVersionedContent runat="server" UIVersion="4">
					<ContentTemplate>
						<h2 style="display:inline;" class="ms-hidden"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,quiklnch_pagetitle%>" EncodeMethod="HtmlEncode"/></h2>
					</ContentTemplate>
				</SharePoint:UIVersionedContent>
				<SharePoint:UIVersionedContent UIVersion="3" runat="server">
					<ContentTemplate>
						<h3 class="ms-standardheader"><label class="ms-hidden"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,quiklnch_pagetitle%>" EncodeMethod="HtmlEncode"/></label>
						<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ViewFormPages">
							<div class="ms-quicklaunchheader"><SharePoint:SPLinkButton id="idNavLinkViewAll" runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" Text="<%$Resources:wss,quiklnch_allcontent%>" accesskey="<%$Resources:wss,quiklnch_allcontent_AK%>"/></div>
						</SharePoint:SPSecurityTrimmedControl>
						</h3>
					</ContentTemplate>
				</SharePoint:UIVersionedContent>
				<Sharepoint:SPNavigationManager
				id="QuickLaunchNavigationManager"
				runat="server"
				QuickLaunchControlId="QuickLaunchMenu"
				ContainedControl="QuickLaunch"
				EnableViewState="false"
				CssClass="ms-quicklaunch-navmgr"
				>
				<div>
					<SharePoint:DelegateControl runat="server"
						ControlId="QuickLaunchDataSource">
					 <Template_Controls>
						<asp:SiteMapDataSource
						SiteMapProvider="SPNavigationProvider"
						ShowStartingNode="False"
						id="QuickLaunchSiteMap"
						StartingNodeUrl="sid:1025"
						runat="server"
						/>
					 </Template_Controls>
					</SharePoint:DelegateControl>
			<SharePoint:UIVersionedContent UIVersion="3" runat="server">
				<ContentTemplate>
					<SharePoint:AspMenu
						id="QuickLaunchMenu"
						runat="server"
						DataSourceId="QuickLaunchSiteMap"
						Orientation="Vertical"
						StaticDisplayLevels="2"
						ItemWrap="true"
						MaximumDynamicDisplayLevels="0"
						StaticSubMenuIndent="0"
						SkipLinkText=""
						CssClass="s4-die"
						>
						<LevelMenuItemStyles>
							<asp:MenuItemStyle CssClass="ms-navheader"/>
							<asp:MenuItemStyle CssClass="ms-navitem"/>
						</LevelMenuItemStyles>
						<LevelSubMenuStyles>
							<asp:SubMenuStyle CssClass="ms-navSubMenu1"/>
							<asp:SubMenuStyle CssClass="ms-navSubMenu2"/>
						</LevelSubMenuStyles>
						<LevelSelectedStyles>
							<asp:MenuItemStyle CssClass="ms-selectednavheader"/>
							<asp:MenuItemStyle CssClass="ms-selectednav"/>
						</LevelSelectedStyles>
					</SharePoint:AspMenu>
				</ContentTemplate>
			</SharePoint:UIVersionedContent>
			<SharePoint:UIVersionedContent UIVersion="4" runat="server">
				<ContentTemplate>
					<SharePoint:AspMenu
					  id="V4QuickLaunchMenu"
					  runat="server"
					  EnableViewState="false"
					  DataSourceId="QuickLaunchSiteMap"
					  UseSimpleRendering="true"
					  Orientation="Vertical"
					  StaticDisplayLevels="2"
					  MaximumDynamicDisplayLevels="0"
					  SkipLinkText=""
					  CssClass="s4-ql" />
				</ContentTemplate>
			</SharePoint:UIVersionedContent>
				</div>
				</Sharepoint:SPNavigationManager>
			<Sharepoint:UIVersionedContent runat="server" UIVersion="3">
				<ContentTemplate>
					<Sharepoint:SPNavigationManager
					id="TreeViewNavigationManager"
					runat="server"
					ContainedControl="TreeView"
					>
					  <table class="ms-navSubMenu1" cellpadding="0" cellspacing="0" border="0">
						<tr>
						  <td>
							<table class="ms-navheader" width="100%" cellpadding="0" cellspacing="0" border="0">
							  <tr>
								<td nowrap="nowrap" id="idSiteHierarchy">
								  <SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" id="idNavLinkSiteHierarchy" Text="<%$Resources:wss,treeview_header%>" accesskey="<%$Resources:wss,quiklnch_allcontent_AK%>"/>
								</td>
							  </tr>
							</table>
						  </td>
						</tr>
					  </table>
					  <div class="ms-treeviewouter">
						<SharePoint:DelegateControl runat="server" ControlId="TreeViewAndDataSource">
						  <Template_Controls>
							<SharePoint:SPHierarchyDataSourceControl
							 runat="server"
							 id="TreeViewDataSource"
							 RootContextObject="Web"
							 IncludeDiscussionFolders="true"
							/>
							<SharePoint:SPRememberScroll runat="server" id="TreeViewRememberScroll" onscroll="javascript:_spRecordScrollPositions(this);" style="overflow: auto;height: 400px;width: 150px; ">
							  <Sharepoint:SPTreeView
								id="WebTreeView"
								runat="server"
								ShowLines="false"
								DataSourceId="TreeViewDataSource"
								ExpandDepth="0"
								SelectedNodeStyle-CssClass="ms-tvselected"
								NodeStyle-CssClass="ms-navitem"
								NodeStyle-HorizontalPadding="2"
								SkipLinkText=""
								NodeIndent="12"
								ExpandImageUrl="/_layouts/images/tvplus.gif"
								CollapseImageUrl="/_layouts/images/tvminus.gif"
								NoExpandImageUrl="/_layouts/images/tvblank.gif"
							  >
							  </Sharepoint:SPTreeView>
							</Sharepoint:SPRememberScroll>
						  </Template_Controls>
						</SharePoint:DelegateControl>
					  </div>
					</Sharepoint:SPNavigationManager>
				</ContentTemplate>
			</SharePoint:UIVersionedContent>
			<Sharepoint:UIVersionedContent runat="server" UIVersion="4">
				<ContentTemplate>
					<Sharepoint:SPNavigationManager
					id="TreeViewNavigationManagerV4"
					runat="server"
					ContainedControl="TreeView"
					CssClass="s4-treeView"
					>
					  <SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" id="idNavLinkSiteHierarchyV4" Text="<%$Resources:wss,treeview_header%>" accesskey="<%$Resources:wss,quiklnch_allcontent_AK%>" CssClass="s4-qlheader" />
						  <div class="ms-treeviewouter">
							<SharePoint:DelegateControl runat="server" ControlId="TreeViewAndDataSource">
							  <Template_Controls>
								<SharePoint:SPHierarchyDataSourceControl
								 runat="server"
								 id="TreeViewDataSourceV4"
								 RootContextObject="Web"
								 IncludeDiscussionFolders="true"
								/>
								<SharePoint:SPRememberScroll runat="server" id="TreeViewRememberScrollV4" onscroll="javascript:_spRecordScrollPositions(this);" style="overflow: auto;height: 400px;width: 155px; ">
								  <Sharepoint:SPTreeView
									id="WebTreeViewV4"
									runat="server"
									ShowLines="false"
									DataSourceId="TreeViewDataSourceV4"
									ExpandDepth="0"
									SelectedNodeStyle-CssClass="ms-tvselected"
									NodeStyle-CssClass="ms-navitem"
									SkipLinkText=""
									NodeIndent="12"
									ExpandImageUrl="/_layouts/images/tvclosed.png"
									ExpandImageUrlRtl="/_layouts/images/tvclosedrtl.png"
									CollapseImageUrl="/_layouts/images/tvopen.png"
									CollapseImageUrlRtl="/_layouts/images/tvopenrtl.png"
									NoExpandImageUrl="/_layouts/images/tvblank.gif"
								  >
								  </Sharepoint:SPTreeView>
								</Sharepoint:SPRememberScroll>
							  </Template_Controls>
							</SharePoint:DelegateControl>
						  </div>
					</Sharepoint:SPNavigationManager>
				</ContentTemplate>
			</SharePoint:UIVersionedContent>
				<SharePoint:UIVersionedContent UIVersion="3" runat="server" id="PlaceHolderQuickLaunchBottomV3">
					<ContentTemplate>
						<table width="100%" cellpadding="0" cellspacing="0" border="0" class="s4-die">
						<tbody>
						<tr><td>
						<table class="ms-recyclebin" width="100%" cellpadding="0" cellspacing="0" border="0">
						<tbody>
						<tr><td nowrap="nowrap">
						<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/recyclebin.aspx" id="v3idNavLinkRecycleBin" ImageUrl="/_layouts/images/recycbin.gif" Text="<%$Resources:wss,StsDefault_RecycleBin%>" PermissionsString="DeleteListItems" />
						</td></tr>
						</table>
						</td></tr>
						</table>
					</ContentTemplate>
				</SharePoint:UIVersionedContent>
				<SharePoint:UIVersionedContent UIVersion="4" runat="server" id="PlaceHolderQuickLaunchBottomV4">
					<ContentTemplate>
						<ul class="s4-specialNavLinkList">
							<li>
								<SharePoint:ClusteredSPLinkButton
									runat="server"
									NavigateUrl="~site/_layouts/recyclebin.aspx"
									ImageClass="s4-specialNavIcon"
									ImageUrl="/_layouts/images/fgimg.png"
									ImageWidth=16
									ImageHeight=16
									OffsetX=0
									OffsetY=428
									id="idNavLinkRecycleBin"
									Text="<%$Resources:wss,StsDefault_RecycleBin%>"
									CssClass="s4-rcycl"
									PermissionsString="DeleteListItems" />
							</li>
							<li>
								<SharePoint:ClusteredSPLinkButton
									id="idNavLinkViewAllV4"
									runat="server"
									PermissionsString="ViewFormPages"
									NavigateUrl="~site/_layouts/viewlsts.aspx"
									ImageClass="s4-specialNavIcon"
									ImageUrl="/_layouts/images/fgimg.png"
									ImageWidth=16
									ImageHeight=16
									OffsetX=0
									OffsetY=0
									Text="<%$Resources:wss,quiklnch_allcontent_short%>"
									accesskey="<%$Resources:wss,quiklnch_allcontent_AK%>"/>
							</li>
						</ul>
					</ContentTemplate>
				</SharePoint:UIVersionedContent>
				</div>
				</div>
	</ContentTemplate>
</SharePoint:UIVersionedContent>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">

<SharePoint:UIVersionedContent UIVersion="4" runat="server">
	<ContentTemplate>
	<div style="padding-left:5px">
	</ContentTemplate>
</SharePoint:UIVersionedContent>
	<table cellpadding="0" cellspacing="0" id="onetIDListForm" style="width:100%">
	 <tr>
	  <td>
	 <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate>
		<WebPartPages:DataFormWebPart runat="server" Description="" ListDisplayName="" PartOrder="2" Default="FALSE" HelpLink="" AllowRemove="True" IsVisible="True" AllowHide="True" UseSQLDataSourcePaging="True" ExportControlledProperties="True" IsIncludedFilter="" DataSourceID="" Title="Clanci" ViewFlag="8" NoDefaultStyle="TRUE" AllowConnect="True" DisplayName="Clanci" PageType="PAGE_NEWFORM" FrameState="Normal" PageSize="-1" PartImageLarge="" AsyncRefresh="False" ExportMode="All" Dir="Default" DetailLink="" ShowWithSampleData="False" ListId="81887a11-8187-4057-af16-98c0907fedff" ListName="{81887A11-8187-4057-AF16-98C0907FEDFF}" FrameType="None" PartImageSmall="" IsIncluded="True" SuppressWebPartChrome="False" AllowEdit="True" EnableOriginalValue="False" ChromeType="None" AutoRefresh="False" AutoRefreshInterval="60" AllowMinimize="True" ViewContentTypeId="" InitialAsyncDataFetch="False" MissingAssembly="Cannot import this Web Part." HelpMode="Modeless" ListUrl="" ID="g_9c703891_ddd6_4d87_a548_63110ebaf433" ConnectionID="00000000-0000-0000-0000-000000000000" AllowZoneChange="True" ManualRefresh="False" __MarkupType="vsattributemarkup" __WebPartId="{9C703891-DDD6-4D87-A548-63110EBAF433}" __AllowXSLTEditing="true" WebPart="true" Height="" Width=""><ParameterBindings>
		 <ParameterBinding Name="ListItemId" Location="QueryString(ID)" DefaultValue="0"/>
		 <ParameterBinding Name="weburl" Location="None" DefaultValue="http://intranet-pu"/>
		 <ParameterBinding Name="ListID" Location="None" DefaultValue="{81887A11-8187-4057-AF16-98C0907FEDFF}"/>
		 <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
		 <ParameterBinding Name="ManualRefresh" Location="WPProperty[ManualRefresh]"/>
		 <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
		 <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
	 </ParameterBindings>
<DataFields>@Title,Title;@Poglavlje,Poglavlje;@Redoslijed,Redoslijed;@Naslov,Naslov;@Tijelo,Tijelo;@Propis,Propis;@VidljivoUStablu,VidljivoUStablu;@Mijenjano,Mijenjano;@ID,ID;@ContentType,Content Type;@Modified,Modified;@Created,Created;@Author,Created By;@Editor,Modified By;@_UIVersionString,Version;@Attachments,Attachments;@File_x0020_Type,File Type;@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@_HasCopyDestinations,Has Copy Destinations;@_CopySource,Copy Source;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;@ItemChildCount,Item Child Count;@FolderChildCount,Folder Child Count;</DataFields>
<Xsl>



<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
	<xsl:output method="html" indent="no"/>
	<xsl:decimal-format NaN=""/>
	<xsl:param name="dvt_apos">'</xsl:param>
	<xsl:param name="ManualRefresh"></xsl:param>
	<xsl:variable name="dvt_1_automode">0</xsl:variable>
	<xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
		<xsl:choose>
			<xsl:when test="($ManualRefresh = 'True')">
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td valign="top">
							<xsl:call-template name="dvt_1"/>
						</td>
						<td width="1%" class="ms-vb" valign="top">
							<img src="/_layouts/images/staticrefresh.gif" id="ManualRefresh" border="0" onclick="javascript: {ddwrt:GenFireServerEvent('__cancel')}" alt="Click here to refresh the dataview."/>
						</td>
					</tr>
				</table>
			</xsl:when>
			<xsl:otherwise>
				<xsl:call-template name="dvt_1"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<xsl:template name="dvt_1">
		<xsl:variable name="dvt_StyleName">ListForm</xsl:variable>
		<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
		<div>
			<span id="part1">
				<table border="0" width="100%">
					<xsl:call-template name="dvt_1.body">
						<xsl:with-param name="Rows" select="$Rows"/>
					</xsl:call-template>
				</table>
			</span>
			<SharePoint:AttachmentUpload runat="server" ControlMode="New"/>
			<SharePoint:ItemHiddenVersion runat="server" ControlMode="New"/>
		</div>
	</xsl:template>
	<xsl:template name="dvt_1.body">
		<xsl:param name="Rows"/>
		<tr>
			<td class="ms-toolbar" nowrap="nowrap">
				<table>
					<tr>
						<td width="99%" class="ms-toolbar" nowrap="nowrap"><IMG SRC="/_layouts/images/blank.gif" width="1" height="18"/></td>
						<td class="ms-toolbar" nowrap="nowrap">
							<SharePoint:SaveButton runat="server" ControlMode="New" id="savebutton1"/>
						</td>
						<td class="ms-separator"> </td>
						<td class="ms-toolbar" nowrap="nowrap" align="right">
							<SharePoint:GoBackButton runat="server" ControlMode="New" id="gobackbutton1"/>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td class="ms-toolbar" nowrap="nowrap">
				<SharePoint:FormToolBar runat="server" ControlMode="New"/>
			</td>
		</tr>
		<xsl:call-template name="dvt_1.rowedit"/>
		<tr>
			<td class="ms-toolbar" nowrap="nowrap">
				<table>
					<tr>
						<td width="99%" class="ms-toolbar" nowrap="nowrap"><IMG SRC="/_layouts/images/blank.gif" width="1" height="18"/></td>
						<td class="ms-toolbar" nowrap="nowrap">
							<SharePoint:SaveButton runat="server" ControlMode="New" id="savebutton2"/>
						</td>
						<td class="ms-separator"> </td>
						<td class="ms-toolbar" nowrap="nowrap" align="right">
							<SharePoint:GoBackButton runat="server" ControlMode="New" id="gobackbutton2"/>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</xsl:template>
	<xsl:template name="dvt_1.rowedit">
		<xsl:param name="Pos" select="position()"/>
		<tr>
			<td>
				<table border="0" cellspacing="0" width="100%">
					<tr>
						<td width="190px" valign="top" class="ms-formlabel">
							<H3 class="ms-standardheader">
								<nobr>Title<span class="ms-formvalidation"> *</span>
								</nobr>
							</H3>
						</td>
						<td width="400px" valign="top" class="ms-formbody">
							<SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="New" FieldName="Title" __designer:bind="{ddwrt:DataBind('i',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}"/>
							<SharePoint:FieldDescription runat="server" id="ff1description{$Pos}" FieldName="Title" ControlMode="New"/>
						</td>
					</tr>
					<tr>
						<td width="190px" valign="top" class="ms-formlabel">
							<H3 class="ms-standardheader">
								<nobr>Poglavlje</nobr>
							</H3>
						</td>
						<td width="400px" valign="top" class="ms-formbody">
							<SharePoint:FormField runat="server" id="ff2{$Pos}" ControlMode="New" FieldName="Poglavlje" __designer:bind="{ddwrt:DataBind('i',concat('ff2',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Poglavlje')}"/>
							<SharePoint:FieldDescription runat="server" id="ff2description{$Pos}" FieldName="Poglavlje" ControlMode="New"/>
						</td>
					</tr>
					<tr>
						<td width="190px" valign="top" class="ms-formlabel">
							<H3 class="ms-standardheader">
								<nobr>Redoslijed<span class="ms-formvalidation"> *</span>
								</nobr>
							</H3>
						</td>
						<td width="400px" valign="top" class="ms-formbody">
							<SharePoint:FormField runat="server" id="ff3{$Pos}" ControlMode="New" FieldName="Redoslijed" __designer:bind="{ddwrt:DataBind('i',concat('ff3',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Redoslijed')}"/>
							<SharePoint:FieldDescription runat="server" id="ff3description{$Pos}" FieldName="Redoslijed" ControlMode="New"/>
						</td>
					</tr>
					<tr>
						<td width="190px" valign="top" class="ms-formlabel">
							<H3 class="ms-standardheader">
								<nobr>Naslov<span class="ms-formvalidation"> *</span>
								</nobr>
							</H3>
						</td>
						<td width="400px" valign="top" class="ms-formbody">
							<SharePoint:FormField runat="server" id="ff4{$Pos}" ControlMode="New" FieldName="Naslov" __designer:bind="{ddwrt:DataBind('i',concat('ff4',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Naslov')}"/>
							<SharePoint:FieldDescription runat="server" id="ff4description{$Pos}" FieldName="Naslov" ControlMode="New"/>
						</td>
					</tr>
					<tr>
						<td width="190px" valign="top" class="ms-formlabel">
							<H3 class="ms-standardheader">
								<nobr>Tijelo<span class="ms-formvalidation"> *</span>
								</nobr>
							</H3>
						</td>
						<td width="400px" valign="top" class="ms-formbody">
							<SharePoint:FormField runat="server" id="ff5{$Pos}" ControlMode="New" FieldName="Tijelo" __designer:bind="{ddwrt:DataBind('i',concat('ff5',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Tijelo')}"/>
							<SharePoint:FieldDescription runat="server" id="ff5description{$Pos}" FieldName="Tijelo" ControlMode="New"/>
						</td>
					</tr>
					<tr>
						<td width="190px" valign="top" class="ms-formlabel">
							<H3 class="ms-standardheader">
								<nobr>Propis</nobr>
							</H3>
						</td>
						<td width="400px" valign="top" class="ms-formbody">
							<SharePoint:FormField runat="server" id="ff6{$Pos}" ControlMode="New" FieldName="Propis" __designer:bind="{ddwrt:DataBind('i',concat('ff6',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Propis')}"/>
							<SharePoint:FieldDescription runat="server" id="ff6description{$Pos}" FieldName="Propis" ControlMode="New"/>
						</td>
					</tr>
					<tr>
						<td width="190px" valign="top" class="ms-formlabel">
							<H3 class="ms-standardheader">
								<nobr>VidljivoUStablu<span class="ms-formvalidation"> *</span>
								</nobr>
							</H3>
						</td>
						<td width="400px" valign="top" class="ms-formbody">
							<SharePoint:FormField runat="server" id="ff7{$Pos}" ControlMode="New" FieldName="VidljivoUStablu" __designer:bind="{ddwrt:DataBind('i',concat('ff7',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@VidljivoUStablu')}"/>
							<SharePoint:FieldDescription runat="server" id="ff7description{$Pos}" FieldName="VidljivoUStablu" ControlMode="New"/>
						</td>
					</tr>
					<tr>
						<td width="190px" valign="top" class="ms-formlabel">
							<H3 class="ms-standardheader">
								<nobr>Mijenjano<span class="ms-formvalidation"> *</span>
								</nobr>
							</H3>
						</td>
						<td width="400px" valign="top" class="ms-formbody">
							<SharePoint:FormField runat="server" id="ff8{$Pos}" ControlMode="New" FieldName="Mijenjano" __designer:bind="{ddwrt:DataBind('i',concat('ff8',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Mijenjano')}"/>
							<SharePoint:FieldDescription runat="server" id="ff8description{$Pos}" FieldName="Mijenjano" ControlMode="New"/>
						</td>
					</tr>
					<tr id="idAttachmentsRow">
						<td nowrap="true" valign="top" class="ms-formlabel" width="20%">
							<SharePoint:FieldLabel ControlMode="New" FieldName="Attachments" runat="server"/>
						</td>
						<td valign="top" class="ms-formbody" width="80%">
							<SharePoint:FormField runat="server" id="AttachmentsField" ControlMode="New" FieldName="Attachments" __designer:bind="{ddwrt:DataBind('i','AttachmentsField','Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Attachments')}"/>
							<script>
          var elm = document.getElementById(&quot;idAttachmentsTable&quot;);
          if (elm == null || elm.rows.length == 0)
          document.getElementById(&quot;idAttachmentsRow&quot;).style.display=&apos;none&apos;;
        </script>
						</td>
					</tr>
					<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
						<tr>
							<td colspan="99" class="ms-vb">
								<span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
							</td>
						</tr>
					</xsl:if>
				</table>
			</td>
		</tr>
	</xsl:template>
</xsl:stylesheet>	</Xsl>
<DataSources>
<SharePoint:SPDataSource runat="server" DataSourceMode="ListItem" SelectCommand="&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;ContentType&quot;/&gt;&lt;Value Type=&quot;Text&quot;&gt;Item&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;" UseInternalName="True" UseServerDataFormat="True"><SelectParameters><WebPartPages:DataFormParameter ParameterKey="ListItemId" PropertyName="ParameterValues" DefaultValue="0" Name="ListItemId"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameter ParameterKey="weburl" PropertyName="ParameterValues" DefaultValue="http://intranet-pu" Name="weburl"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{81887A11-8187-4057-AF16-98C0907FEDFF}" Name="ListID"></WebPartPages:DataFormParameter>
</SelectParameters><UpdateParameters><WebPartPages:DataFormParameter ParameterKey="ListItemId" PropertyName="ParameterValues" DefaultValue="0" Name="ListItemId"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameter ParameterKey="weburl" PropertyName="ParameterValues" DefaultValue="http://intranet-pu" Name="weburl"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{81887A11-8187-4057-AF16-98C0907FEDFF}" Name="ListID"></WebPartPages:DataFormParameter>
</UpdateParameters><InsertParameters><WebPartPages:DataFormParameter ParameterKey="ListItemId" PropertyName="ParameterValues" DefaultValue="0" Name="ListItemId"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameter ParameterKey="weburl" PropertyName="ParameterValues" DefaultValue="http://intranet-pu" Name="weburl"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{81887A11-8187-4057-AF16-98C0907FEDFF}" Name="ListID"></WebPartPages:DataFormParameter>
</InsertParameters><DeleteParameters><WebPartPages:DataFormParameter ParameterKey="ListItemId" PropertyName="ParameterValues" DefaultValue="0" Name="ListItemId"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameter ParameterKey="weburl" PropertyName="ParameterValues" DefaultValue="http://intranet-pu" Name="weburl"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{81887A11-8187-4057-AF16-98C0907FEDFF}" Name="ListID"></WebPartPages:DataFormParameter>
</DeleteParameters>
</SharePoint:SPDataSource>
</DataSources>
</WebPartPages:DataFormWebPart>

</ZoneTemplate></WebPartPages:WebPartZone>
	 <img src="/_layouts/images/blank.gif" width='590' height='1' alt="" />
	  </td>
	 </tr>
	</table>
<SharePoint:UIVersionedContent UIVersion="4" runat="server">
	<ContentTemplate>
	</div>
	</ContentTemplate>
</SharePoint:UIVersionedContent>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
	<UseStandardControl xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">true</UseStandardControl>
<script type="text/javascript" src="/Style%20Library/Resources/jsTree/_lib/jquery.js"></script>
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("main");

function main() {
//    $('nobr:contains("Poglavlje")').closest('tr').hide();
    $('nobr:contains("Title")').closest('tr').hide();
    $('nobr:contains("Redoslijed")').closest('tr').hide();
//    $('nobr:contains("Propis")').closest('tr').hide();
    $('nobr:contains("VidljivoUStablu")').closest('tr').hide();
    $('nobr:contains("Mijenjano")').closest('tr').hide();

	$('input[title="VidljivoUStablu"]').attr('checked', true);
	
	var redoslijed = getParameterByName('Redoslijed');
    $('input[title="Redoslijed"]').val(redoslijed);
	
	var poglavlje = getParameterByName('Poglavlje');
	if(poglavlje != 0) {
		setLookupFromFieldName("Poglavlje", poglavlje);
    }
    
	var propis = getParameterByName('Propis');
	if(propis != 0) {
		setLookupFromFieldName("Propis", propis);
    }
    
    $.ajax({
        url: "/_vti_bin/SviPropisiSvc/SviPropisiService.svc/GetNewGuid",
        contentType: "application/json; charset=utf-8",
        cache: false,
        type: "GET",
        dataType: "json",
        success: function (result) {
	        $('input[title="Title"]').val(result);
        },
        error: function (xhr, ajaxOptions, thrownError) {
            // TODO: Staviti nesto smisleno.
            alert('Greska!');
        }
    });
}

// Dohvaca vrijednost QueryString parametra po imenu.
// name: Ime QueryString parametra.
function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var results = regex.exec(window.location.search);
    if (results == null)
        return "";
    else
        return decodeURIComponent(results[1].replace(/\+/g, " "));
} 

//setLookupFromFieldName 
//Sets the value of a select of a given name to the option of the given value 
//parameters:  fieldName:  name of select to set 
//             value:   option to set select to 
//returns:  nada 
function setLookupFromFieldName(fieldName, value) { 
     if (value == undefined) return; 
     var theSelect = getTagFromIdentifierAndTitle("select","Lookup",fieldName); 
     //if the select wasn't found, try getting it as an 'input' type 
     if (theSelect == null) { 
          var theInput = getTagFromIdentifierAndTitle("input","",fieldName); 
          ShowDropdown(theInput.id); 
          var opt=document.getElementById(theInput.opt); 
          setSelectedOption(opt, value); 
          OptLoseFocus(opt); 
     } else { 
          setSelectedOption(theSelect, value); 
     } 
} 

//setSelectedOption 
//Set the value of a select to the given option 
//parameters:  select:  Select object to set 
//             value:  Value in options to set select to 
//returns:  true if value was set, false if option could not be found to set value to 
function setSelectedOption(select, value) { 
     //get list of options 
     var opts = select.options; 
     var l = opts.length; 
     if (select == null) return; 
     //loop through all the options 
     for (var i=0; i < l; i++) { 
      //if the option is found that is the same as the value, set the value 
          if (opts[i].value == value) { 
               select.selectedIndex = i; 
               return true; 
	     } 
	} 
     return false;
}

//getTagFromIdetifierAndTitle 
//Get form field by type & title 
//parameters:  tagName:  type of tag to return (‘input’ & ‘select’ are the ones I use) 
//             identifier:   Optional identifier of the tagName in question 
//             title:         The specific title (name) of the field you would like to retrieve  
//returns:  field object to set or get value of (or do whatever you want I guess) 
function getTagFromIdentifierAndTitle(tagName, identifier, title) { 
     var len = identifier.length; 
     var tags = document.getElementsByTagName(tagName); 
     for (var i=0; i < tags.length; i++) { 
          var tempString = tags[i].id; 
          //if you are not sure what the actual title of your field is, uncomment this alert 
          //alert(tags[i].title); 
          if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len)) { 
               return tags[i]; 
          } 
      } 
      return null; 
} 

</script>


	<SharePoint:UIVersionedContent UIVersion="4" runat="server"><ContentTemplate>
		<SharePoint:CssRegistration Name="forms.css" runat="server"/>
	</ContentTemplate></SharePoint:UIVersionedContent>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleLeftBorder" runat="server">

<table cellpadding="0" height="100%" width="100%" cellspacing="0">
 <tr><td class="ms-areaseparatorleft"><img src="/_layouts/images/blank.gif" width='1' height='1' alt="" /></td></tr>
</table>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleAreaClass" runat="server">

<script type="text/javascript" id="onetidPageTitleAreaFrameScript">
	if (document.getElementById("onetidPageTitleAreaFrame") != null)
	{
		document.getElementById("onetidPageTitleAreaFrame").className="ms-areaseparator";
	}
</script>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderBodyAreaClass" runat="server">

<style type="text/css">
.ms-bodyareaframe {
	padding: 8px;
	border: none;
}
</style>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderBodyLeftBorder" runat="server">

<div class='ms-areaseparatorleft'><img src="/_layouts/images/blank.gif" width='8' height='100%' alt="" /></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleRightMargin" runat="server">

<div class='ms-areaseparatorright'><img src="/_layouts/images/blank.gif" width='8' height='100%' alt="" /></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderBodyRightMargin" runat="server">


<div class='ms-areaseparatorright'><img src="/_layouts/images/blank.gif" width='8' height='100%' alt="" /></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleAreaSeparator" runat="server"/>

IN2_slavens on Thu, 08 Nov 2012 09:45:17


I have figured it why I don't have <webpart> element in my EditForm.aspx. This site was created with "Team Site" template.

When I try to put <UseStandardControl> element in EditForm.aspx of list which was created in "Publishing site" site then the patch works!

I will try to copy the markup from "Team site" to "Publishing site" and see how it goes.

Nicholasd1980 on Thu, 08 Nov 2012 22:49:21


Well done on determining why the list forms would be different - I didn't think the site template would affect this, I thought all List Forms would contain web parts.

Nicholas Demos


wadneyare on Tue, 20 Nov 2012 20:51:28


To resolve this issue go the below link and install the hotfix. After the hotfix installed open the site where the lookup column lives in sharepoint designer. click list and libraires, click the editform.aspx link and click advanced mode for editing. The form will display in edit mode. scroll down and find out WePart section and insert:  
<UseStandardControl xmlns="true</UseStandardControl">http://schemas.microsoft.com/WebPart/v2/ListForm">true</UseStandardControl>

just below the webpart section. do the same for newform.aspx and save your work and you are Done! Good Luck.

http://support.microsoft.com/kb/2687375/de?wa=wsignin1.0
To resolve this issue, apply the following hotfix package:

2687339
Description of the SharePoint Foundation 2010 hotfix package (Wss-x-none.msp): August 28, 2012 After you apply the hotfix package, you must create the following flag in the NewForm.aspx page and in the EditForm.aspx page by using SharePoint Designer:
<UseStandardControl xmlns="true</UseStandardControl">http://schemas.microsoft.com/WebPart/v2/ListForm">true</UseStandardControl>

Galan

IN2_slavens on Wed, 21 Nov 2012 10:12:08


wadneyare,

You're absolutelly right. My conclusion about site templates appears to be incorrect. I was creating new EditForm.aspx with SharePoint Designer and that's the real reason why I didn't have <webpart> element. To apply this fix to a new EditForm.aspx you need to replace <DataFormWebPart> with <ListFormWebPart> element from original EditForm.aspx that comes when you create a list. After you copy the webpart element you need to change GUIDs in <ListFormWebPart __WebPartId> attribute and <ListId> element. This has to be the same newly generated GUID.

J_Kickinger on Fri, 22 Mar 2013 07:33:45


Hello all,

I have exactely the same error - I could solve it by setting the usestandardcontrol flag to true.

BUT: my customer created a seperate view and uses inline editing in his list and so the error is still there. Any ideas how to get rid of it, when inline editing is activated?

Thanks,
Johannes

Kirchh on Wed, 27 Mar 2013 15:14:27


Hemendra Agrawal:

Please don't mark posts as answers when it is clear that there are continuing problems, as would have been obvious if you had taken the time to actually read the posts following the one you marked.

Thanks.

Steven Andrews on Wed, 27 Mar 2013 16:58:46


Hemendra Agrawal:

Please don't mark posts as answers when it is clear that there are continuing problems, as would have been obvious if you had taken the time to actually read the posts following the one you marked.

Thanks.

In his defence, he's marking a post that was proposed as an answer 5 months ago.  You as the OP could have quite easily unmarked that as a proposed answer.

By your reaction, I'm assuming that the hotfixes mentioned above are of no use?

awell on Mon, 03 Jun 2013 02:58:12


(In response to TePartire):

Thanks, that worked for me (we already had our own event receiver on all our lists, so was a simple matter to add this code)...
However, I had to add the same code into the ItemUpdating event as well, to handle the case of updating an existing item to have "(None)" for the lookup value, which was also making the same error.

I proposed the event receiver solution as an answer, because for me, installing the hotfix isn't really an option. Not to mention that SPD is required to complete the fix (what is with that??), and SPD doesn't get let anywhere near the network that my farm is on. Event receiver is an effective workaround for me.

Fernando Rodríguez on Mon, 03 Jun 2013 07:21:54


nice :)

TePartire on Wed, 05 Jun 2013 13:41:17


Glad it was useful :)