SharePoint 2013

Jan 11, 2013 at 2:20 PM

Just curious, in the process of upgrading a SharePoint 2010 installation to SharePoint 2013. Does this solution work with SharePoint 2013?

Feb 20, 2013 at 7:04 PM
Hi there,

I didnt upgrade from 2010 but I tried to install on a clean SP2013 installation.

When you select the field type "Filtered Lookup" it does now allow you to configure the site/list in order to retrieve data.

It select the current site and the first list (alphabetical order) and does not allow you to change that.

I think this might be a bug.

Bruno
Apr 16, 2013 at 3:05 PM
You have to modify SetControlVisibility() method of the FilteredLookupFieldEditor class.
Change the URL of the fldNew.aspx and the FldNewEx.aspx pages.
The new values must include the "15" subfolder like:
      if (!string.IsNullOrEmpty(referrer)) {
        if (referrer.IndexOf("_layouts/15/fldNew.aspx") > -1
          || referrer.IndexOf("_layouts/15/FldNewEx.aspx") > -1) // adding new field
After that you'll probably find another problem with the list rendering. I'm working on it.
May 12, 2013 at 9:26 PM
Hi,

I am experiencing the same list rendering problem as you mentioned. Any progress on your work?

Thanks in advance,

Kr
May 13, 2013 at 1:31 PM

No, haven’t been able to upgrade the solution,

Brian.

May 24, 2013 at 11:23 AM
Edited May 24, 2013 at 11:25 AM
Resolved with Client Side Rendering, overriding JSLink property and providing Javascript logic to render the list view:

File: FilteredLookupField.cs
  
    /// <summary>
    /// JSLINK Override only when in view mode 
    /// </summary>
    public override string JSLink
    {
        get
        {
            if (SPContext.Current.FormContext.FormMode != SPControlMode.Invalid)
                return base.JSLink;   // that is customtemplates.js
            else
                return JSLinkUrl;   // constant string that point to custom js file
        }
        set
        {
            base.JSLink = value;
        }
    }
and this is my custom javascript for rendering:
(function () {

    var filteredLookupContext = {};

    // Init Templates object for View mode
    filteredLookupContext.Templates = {};
    filteredLookupContext.Templates.Fields = {
        "FilteredLookupField": { "View": filteredLookupViewTemplate } // pass rendering control to delegate function filteredLookupViewTemplate
    };
    // register rendering overriding
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(filteredLookupContext);
})();

function filteredLookupViewTemplate(ctx) {
    var lookup = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
    // read lookup value and returns as string
    if (lookup)
        return lookup[0].lookupValue;
    return "-";
}
May 28, 2013 at 3:58 PM

Hi,

Have you updated the WSP on the CodePlex site?

Or, could you send me the updated WSP file?

Cheers,

Brian.

Jun 6, 2013 at 2:39 PM
Edited Jun 6, 2013 at 2:40 PM
Hi vitdan79, all,

I try to compile the solution and build the wsp file myself - unfortunately I'm not able to implement the fix that vitdan79 introduces above. I wonder if you could give a little more instructions on how to get this fix into the solutions - maybe even update the whole .cs-file in a way that it can be incorporated into the solution.

Many seem to be waiting for a solution that will work on 2013 - also the multivalue-issue is open I think!

Best regards,
Henning
Dec 4, 2013 at 9:50 AM
The solution proposed by Vitdan79 gave me a hint how to resolve this issue in my project. I had the same issue with my codeplex project which is based on Lookup field. I added a link to dummy JS file and overrode the JSLink property of the field class. I have blogged about it http://sharepointnadeem.blogspot.in/2013/12/sharepoint-2013-upgrade-sharepoint-2010.html
Feb 24, 2014 at 6:03 AM
Hi all.

This is link of porting this project to SharePoint 2013 http://sp2013filteredlookup.codeplex.com/