locked
Lookup column question RRS feed

  • Question

  •  Hi all,

    I have running into a problem with SharePoint's Look up column.

    I have created a list which contains a list of courses which we offer for
    training (25 courses)

    I then created another list which is used for students to register a course.
    This list contains a field 'course'  which I specified as a lookup column
    and linked it to the first list to get the list of courses available. When I
    create a new item using this list, I found that my 'course' field which
    suppose to be a dropdown list of the courses in the first list is not
    working (i.e. clicking on the error & the list won't show up).

    After many playing around & testing with different list, content type, list
    type, column type etc, I finally figured it out that when my course list
    contains more than 19 items, the dropdown will stop working. So there must
    be a limit number of items can be used for lookup column (20 from my test as
    there is an empty record as default).

    My questions is has anyone had this problem before? and is there anywhere I
    can change the limit?

    Please help.

    Thank you.
    Thursday, October 23, 2008 6:13 AM

Answers

  • Hello Bing,

    I wish I could copy paste images into here...

    Anyways, basically you can customize your own field control that would work the same way if you really want. This is a developer task and is pretty much as easy (if not easier) than building a webpart.
     
    That IE control SHOULD show the drop down (it does on my computer here running under IE 7, and I also tested IE 8 (beta 2)). The key is that it also does 'smart' advice based on what you input. So in your example when I type the number 1 in that field it should automatically show drop down options for ANY item that starts with the 1 character. So it may look different (because it accepts input) but it should also allow you to use the typical drop down methods as well.

    This is by design because when you have more than 20 items it's assumed the user doesn't want to scroll through potentially hundreds of items in the lookup. By typing in the first letters and providing possible results it improves user experience.

    So what I am saying here is it's not SharePoint, and most likely not IE that is causing the issue. Keep in mind that if your browser does not have certain javascript/activex abilities turned on SharePoint can behave differently. It's always a good idea to add SharePoint as a trusted site or intranet site to make sure the browser settings do not hamper your use of SharePoint. I would check IE browser settings to make sure it's not something like what I mention here.

    If you are using a different version of IE than what I mentioned and for some reason users are not able to be upgraded to IE 7 please let me know and I will do further testing on an older IE browser to ensure my assumptions are correct.

    Hope this helps,
    Richard

    Wednesday, October 29, 2008 1:12 PM
  • Are you using a custom master page?

    It sounds like the page is looking for a javascript reference and cannot find it. Odds are a javascript file is missing from being loaded on the page.

    If you can debug the page it might show you what js line is erroring out or what call is erroring. I know this is possible with Visual Studio, don't know what tools you have available.

    I don't think you need a full out custom code solution for this, it's probably something we can resolve once we discover why it's happening.

    Let me know if the master page or js makes sense or you think could also be the cause,
    Richard
    Thursday, October 30, 2008 12:03 PM

All replies

  • While I can't say what is happening in your situation I can tell you that personally I have look up columns running right now with hundreds of options.

    Out of curiousity what is the 20th entry? Does it contain special characters?

    Have you tried seeing what happens if you set up the lookup column for multiple values to see if the result is different when rendering in a listbox as opposed to a dropdown? If an error is occuring can you provide more information on it?

    Also it is probably a good idea to check the SharePoint logs and event viewer of the server to see if it captures more details.

    Sorry I couldn't help yet, but hopefully with some more information we can pin point the issue.
    Thursday, October 23, 2008 12:43 PM
  • Hi,

    Thank you for your reply.

    Here is what I have done to test:

    I created the simplest 'custom list' then add nothing else to that so it only has one 'title' field. I then create a list add a 'lookup' column
    to show the title field, then I created items up to the 19th one (the values are just simple 1 to 19) then I added item number 20 (which is '20'), then suddently the dropdown box stoped working. (by stop working I mean, when you click on the arrow, the list will not show, but you can input the value into the field)

    I have tried with allwoing multiple selection & it works fine with more than 20 items.

    I have also found out (with help of someone from another newsgroup) that the dropdown list actually works fine in firefox but just not IE! I was also told that Under 20 items, the lookup is a select tag with options. Above 20 items, it is an input tag.  I am kind of confused, is this a problem with SharePoint or IE?

    My question is: is it possible to make it a slection tag for above 20 items as well? can it be fixed so it works on IE as well? Majority of my users are using IE & I can not rely on them to input the correct value either.

    Thank you for your help.

    Bing
    Tuesday, October 28, 2008 11:10 PM
  • Hello Bing,

    I wish I could copy paste images into here...

    Anyways, basically you can customize your own field control that would work the same way if you really want. This is a developer task and is pretty much as easy (if not easier) than building a webpart.
     
    That IE control SHOULD show the drop down (it does on my computer here running under IE 7, and I also tested IE 8 (beta 2)). The key is that it also does 'smart' advice based on what you input. So in your example when I type the number 1 in that field it should automatically show drop down options for ANY item that starts with the 1 character. So it may look different (because it accepts input) but it should also allow you to use the typical drop down methods as well.

    This is by design because when you have more than 20 items it's assumed the user doesn't want to scroll through potentially hundreds of items in the lookup. By typing in the first letters and providing possible results it improves user experience.

    So what I am saying here is it's not SharePoint, and most likely not IE that is causing the issue. Keep in mind that if your browser does not have certain javascript/activex abilities turned on SharePoint can behave differently. It's always a good idea to add SharePoint as a trusted site or intranet site to make sure the browser settings do not hamper your use of SharePoint. I would check IE browser settings to make sure it's not something like what I mention here.

    If you are using a different version of IE than what I mentioned and for some reason users are not able to be upgraded to IE 7 please let me know and I will do further testing on an older IE browser to ensure my assumptions are correct.

    Hope this helps,
    Richard

    Wednesday, October 29, 2008 1:12 PM
  • Hi Richard,

    Thank you for your help, I really appreciate it.

    I am using IE7 but on my computer the drop down does not 'drop' & when I type in, it also does not show up the options & I have to type in the exact value otherwise it will say  "Value is not among the set of valid lookup values."

    (So for my real list this is not feasible because I am intend to create a training register list & the lookup field would be the course title, they are quite long & I can't expect user to know the exact name. )


    I have added my sharepoint site in the local intranet site, no help.

    I notice in IE, when after I click on the drop down box arrow I get an error down the bottom of the window, and it says ' Line 2210 Char 2 Object required ' I checked on my Newform.aspx page, there is no line 2210.

    Really stuck here. I am not a developer, I try to avoid writing code as much as I can, everything else on the list does exactly what I want except this problem :(

    Bing
    Thursday, October 30, 2008 4:53 AM
  • Are you using a custom master page?

    It sounds like the page is looking for a javascript reference and cannot find it. Odds are a javascript file is missing from being loaded on the page.

    If you can debug the page it might show you what js line is erroring out or what call is erroring. I know this is possible with Visual Studio, don't know what tools you have available.

    I don't think you need a full out custom code solution for this, it's probably something we can resolve once we discover why it's happening.

    Let me know if the master page or js makes sense or you think could also be the cause,
    Richard
    Thursday, October 30, 2008 12:03 PM
  • Yes, you are facing real problem with MOSS2007, once you add > 20 or more ntries in lookup- it might not work properly, try using SP 1 of MOS2007, And enjoy.
    • Proposed as answer by zrace718 Tuesday, June 23, 2009 9:31 PM
    Tuesday, November 4, 2008 7:58 AM
  • I just ran into the same problem. It took me a whole to find an answer. Since i was using a custom master page , after reading this post i change the master page and everything worked fine. This resolve the issue that the problem is in the mater page . I added the follwing tr tag and it works fine .

    <tr style="z-index: -3; position: absolute;">
       <td colspan=4 class="ms-globalbreadcrumb" style="z-index: -3">
       <span id="TurnOnAccessibility" style="display:none">
          <a href="#" class="ms-skip" onclick="SetIsAccessibilityFeatureEnabled(true);UpdateAccessibilityUI();return false;">
       <SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,master_turnonaccessibility%>" EncodeMethod="HtmlEncode"/></a>
       </span>
       <A href="javascript:;" onclick="javascript:this.href='#mainContent';" class="ms-skip" AccessKey="<%$Resources:wss,maincontent_accesskey%>" runat="server">
       <SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,mainContentLink%>" EncodeMethod="HtmlEncode"/></A>
       <table cellpadding=0 cellspacing=0 height=100% class="ms-globalleft">
         <tr>
       <td class="ms-globallinks" style="padding-top: 2px;" height=100% valign=middle>
        <div>
         <span id="TurnOffAccessibility" style="display:none">
        <a href="#" class="ms-acclink" onclick="SetIsAccessibilityFeatureEnabled(false);UpdateAccessibilityUI();return false;">
        <SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,master_turnoffaccessibility%>" EncodeMethod="HtmlEncode"/></a>
         </span>
         <asp:ContentPlaceHolder id="PlaceHolderGlobalNavigationSiteMap" runat="server">
        <asp:SiteMapPath SiteMapProvider="SPSiteMapProvider" id="GlobalNavigationSiteMap" RenderCurrentNodeAsLink="true" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/>
         </asp:ContentPlaceHolder>
         </div>
        </td>
         </tr>
    Tuesday, June 23, 2009 9:37 PM
  • I came across the same problem. What caused it for me was a simple position:relative for one of the container DIVs in my custom css. That broke the whole lookup functionality if there were 20 items or more. So maybe a tip for those who have the same problem: disable your custom CSS to check if that fixes the lookup column problem. If it does: search for positioning of your DIVs.

    Good luck.

    Wednesday, December 2, 2009 12:40 AM
  • Thank you andreasbbbbb your answer solved my problem.
    Tuesday, February 1, 2011 6:08 PM
  • Who you are who is unlocking threads I have locked. STOP DOING IT.

    The OP's question was answered by a poster in 2009.

    Thus the thread ought to be locked. Even follow-up posts have been answered.

    There is NO reason for unlocking this thread. I take great care to only Lock threads that ought to be locked.

    Stop messing up my hard work like this  NOW.

    Mike Walsh


    SP 2010 "FAQ" (mainly useful links): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ and Links) http://wssv3faq.mindsharp.com/default.aspx
    Both also have links to extensive book lists and to (free) on-line chapters
    Tuesday, February 1, 2011 9:22 PM