Trouble with Document set

Dec 29, 2010 at 2:42 PM

I am try to use it with a new item page of DOCUMENT SET.
I have a lookup column named OBBLIGATO, but the javascript debug say : The column do not apper to be a lookup column.
can help me ?

Coordinator
Dec 29, 2010 at 3:49 PM

uniprof:

I'm going to have to look into this. As I mentioned in my prior comment, I've never tested SPLookupAddNew with Document Sets. It'll probably be up to a week before I get back to you...

M.

Coordinator
Dec 29, 2010 at 3:51 PM

p.s. Are you running a different language of SharePoint besides English? Have you used SPLookupAddNew on another form in your installation successfully?

Dec 29, 2010 at 4:09 PM

I am running with Italian language.

I will try right now with different form, will keep you informed in 10 mins.

Dec 29, 2010 at 4:21 PM

Tryng with a simple list don't work at all.

Coordinator
Dec 29, 2010 at 4:30 PM

OK, this could be an issue with the Italian version (potentially) then.  See my article on some of the issues with other language versions:
http://sharepointmagazine.net/articles/variations-in-multiselect-controls-in-different-sharepoint-language-versions

What type of lookup column is this? Simple, complex, or multi-select? (See my article for the definitions.)

Can you send me a View Source of the pages you're trying this on? marc dot anderson [at] sympraxisconsulting dot com.

M.

Dec 29, 2010 at 4:38 PM

This is a simple lookup column.

Source code sent.

Giuseppe

Coordinator
Dec 29, 2010 at 5:16 PM
Edited Dec 29, 2010 at 6:06 PM

Got your source. I was actually looking for the View Source from the browser to see how things are rendered.

One thing I noticed was the placement of the script. Take a look at the main documentation page and try putting the script where I recommend instead.

M.

Dec 29, 2010 at 5:34 PM

Attached the view.

Da: sympmarc [email removed]
Inviato: mercoledì 29 dicembre 2010 18:17
A: Giuseppe Porcelli
Oggetto: Re: Trouble with Document set [SPServices:239888]

From: sympmarc

Got your source. I was actually looking for the View Source from the browser to see how things are rendered.

One thing I noticed was the pacement of the script. Take a look at the main documentation page and try putting the script where I recommend instead.

M.

Dec 29, 2010 at 5:54 PM

Can you help me?

Coordinator
Dec 29, 2010 at 6:05 PM

Didn't get the view, but did you change where you have placed the script?

M.

Dec 30, 2010 at 5:33 PM

I have send the source view and the image.

Coordinator
Jan 3, 2011 at 2:03 PM

Giuseppe:

Sorry for the delay in getting back to you. I was sick over the holidays and got very backed up.

It took some staring at it, but I think I see the problem. Because you don't have the call to SPLookupAddNew swrapped in a $(document).ready, the column isn't actually in the page yet when the script runs. Try this:

<script language="javascript" type="text/javascript" src="/javascript/jquery-1.4.4.js"></script>
<script language="javascript" type="text/javascript" src="/javascript/jquery.SPServices-0.5.8P1.js"></script>
<script>
  $(document).ready(function() {
    $().SPServices.SPLookupAddNew({ 
      lookupColumn: "agenzia",
      promptText: "Add new {0}",
      debug: true
    });
  });
</script>

Note the caveat about using this function in SharePoint 2010 at the top of the documentation page.

M.

Jan 3, 2011 at 2:58 PM

Good!!! Now work as charm!!!

Now we must come back on the real problem, we must use with a new item page of DOCUMENT SET

Any suggestion?

Giuseppe

 

Coordinator
Jan 3, 2011 at 3:00 PM

Excellent! Progress, at least.

Did you try the same code with a Document Set? If so, what's happening?

M.

Jan 3, 2011 at 4:32 PM

I have tried modifing the original page unser layout directory (newdocset.aspx).

The debus say that column do not exist.

Attached the code.

Giuseppe

<%-- _lcid="1033" _version="14.0.4758" _dal="1" --%>
<%-- _LocalBinding --%>
<%@ Assembly Name="Microsoft.Office.DocumentManagement.Pages, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@ Assembly Name="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%> <%@ Page Language="C#" DynamicMasterPageFile="~masterurl/default.master" Inherits="Microsoft.Office.DocumentManagement.Pages.NewDocSet"       %> <%@ Import Namespace="Microsoft.SharePoint.WebControls" %> <%@ 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="wssuc" TagName="LinksTable" src="/_controltemplates/LinksTable.ascx" %> <%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="/_controltemplates/InputFormSection.ascx" %> <%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="/_controltemplates/InputFormControl.ascx" %> <%@ Register TagPrefix="wssuc" TagName="LinkSection" src="/_controltemplates/LinkSection.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="/_controltemplates/ButtonSection.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ActionBar" src="/_controltemplates/ActionBar.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ToolBar" src="/_controltemplates/ToolBar.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="/_controltemplates/ToolBarButton.ascx" %> <%@ Register TagPrefix="wssuc" TagName="Welcome" src="/_controltemplates/Welcome.ascx" %>
<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content contentplaceholderid="PlaceHolderPageTitle" runat="server">
	<asp:Literal id="dlgTitleLiteral" runat="server"/>
</asp:Content>
<asp:Content contentplaceholderid="PlaceHolderPageTitleInTitleArea" runat="server">
	<asp:Literal id="windowTitleLiteral" runat="server"/>
</asp:Content>
<asp:Content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
	<SharePoint:CssRegistration name="forms.css" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderID="PlaceHolderMain" runat="server">
	<SharePoint:SPPageStatusSetter id="PageStatus" runat="server"/>
	<asp:PlaceHolder runat="server" id="ListFormWebPartPlaceHolder"/>


	<wssuc:ButtonSection runat="server">
		<Template_Buttons>
			<asp:button class="ms-ButtonHeightWidth" runat="server" text="<%$Resources:wss,multipages_okbutton_text%>" onclick="OKBtn_Click" id="btnOK" />
		</Template_Buttons>
	</wssuc:ButtonSection>
<script language="javascript" type="text/javascript" src="/javascript/jquery-1.4.4.js"></script>
<script language="javascript" type="text/javascript" src="/javascript/jquery.SPServices-0.5.8P1.js"></script>
<script>
  $(document).ready(function() {
    $().SPServices.SPLookupAddNew({ 
      lookupColumn: "Obbligato",
      promptText: "Add new {0}",
      debug: true
    });
  });
</script>
</asp:Content>
Coordinator
Jan 3, 2011 at 6:00 PM

First off, it's a very bad idea to edit pages in the _layouts folder directly. Secondly, newdocset.aspx probably wouldn't be the right page. Editing that page would make the change for *every* Document Set in the entire farm (well, on that WFE).

M.

Oct 8, 2011 at 2:47 AM

I have a similar problem with SPLookupAddNew.  When I click on the add new link, I am redirected to the new file uploaded dialogue from the Doc Library.  I have tried setting Document Sets as the default.  I have also removed the standard documents content type, such that Document Sets remain as the only type.  However, I still do not get directed to the new form for the Documents Sets.  Any ideas?

Thanks!

-M.J.

Coordinator
Oct 14, 2011 at 1:33 AM

M.J.

I'm not sure what's happening, as I haven't tested this with Document Sets. Basically, I'm just directing the user to the NewForm for the list. In the case of a Document Library, that's the upload.aspx page.

M.

Oct 19, 2011 at 10:18 PM

Marc -

A new doc set is redirected into /_layouts/newdocset.aspx, with passed parameters including a ContentType ID that allows the page to determine the necessary input fields.

I "appended" to your function to include a few other fields, mainly an override URL and and CID.   When it sees the OverRideURL, I ignore the NewURL field and go to the OverRide, such that I can use it to redirect to the NewDocSet page.  The other necessary parameters are the CID are appended into the URL as appropriate when the field is not Null...

 

The URL works fine, gets me to the NewDocSet page, just fine.  However, once I have added the New Document Set, I am sent to the new document set page rather than returned to the source list.   Looks like perhaps NewDocSet.aspx ignores the source parameter.

 

-M.J.