Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jamie Attwood 130 posts 342 karma points
    1 week ago
    Jamie Attwood
    0

    Unable to retrieve values from Multinode Tree Picker (MNTP2) from IMember

    In Umbraco 7.15.3, I have a MNTP2 storing a list of related members on a member profile. I call the property "memberReferrals".

    I am trying to query the value, update it and save using through the memberservice:

    Guid referringMemberGuid = new Guid(model.ReferringMemberGuid);
    var referringMember = memberService.GetByProviderKey(referringMemberGuid);
    var myValues = referringMember.GetValue<IEnumerable<IPublishedContent>>("memberReferrals");
    

    In the case above, myValues returns empty, even though there is an entry in the profile and the property returns not null.

    I can do this by using the Umbraco helpers and the values return as expected...but not when using the memberservice.

        Guid referringMemberGuid = new Guid(model.ReferringMemberGuid);
        var referringMemberHelper= Members.GetByProviderKey(referringMemberGuid);
    
        if (referringMemberHelper.HasValue("memberReferrals"))
        {
            var pastReferrals = referringMemberHelper.GetPropertyValue<IEnumerable<IPublishedContent>>("memberReferrals");
        }
    

    Any ideas why this would you cant get MNTP values returned from MemberService? Seems a little excessive to have to use both the IMember service plus the IPublished content just to get and update a value.

Please Sign in or register to post replies

Write your reply to:

Draft