Copied to clipboard

Flag this post as spam?

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


  • lucuma 261 posts 563 karma points
    May 02, 2014 @ 15:40
    lucuma
    0

    MemberGroup and AdditionalData

    I'm trying to match an ID from an external system with a MemberGroup (Role). This object has AdditionalData but whenever I try to save it nothing gets saved.

    memberGroup.AdditionalData.Add("jobId", 1);

    _memberGroupService.Save(memberGroup);

    So, is it possible and there is a workaround or does someone have a suggestion on a better way besides a lookup table which I'm using now: jobId, memberGroupId

  • Charles Afford 1163 posts 1709 karma points
    May 05, 2014 @ 17:03
    Charles Afford
    0

    Hi could you give us a bit more code for an example.  Which version of umbraco you are uisng.  razor/webforms/c#?

    What is the end goal?

    Thanks,

    Charlie.

  • lucuma 261 posts 563 karma points
    May 05, 2014 @ 17:04
    lucuma
    0

    v7.1.1 razor/c#

  • Charles Afford 1163 posts 1709 karma points
    May 05, 2014 @ 17:07
    Charles Afford
    0

    Ok so are you trying to save a value from an external system on custom property on a member in Umbraco?

    Charlie :)

  • lucuma 261 posts 563 karma points
    May 05, 2014 @ 17:11
    lucuma
    0

    Sorry let me give a little more background. We are developing a quiz builder for a company that has say a few thousand employees. The employee info is in an external system and they will be sending us a weekly flat file that has an id, first name, and last name.

    We will be creating members in umbraco based on this and I'd like to relate each member back to the source system id somehow. Right now I have a lookup table, but would rather use another property on the member if possible so on future feed runs I can match up the source system user to the umbraco one. The lookup table works fine but anytime I can eliminate a table and simplify I'm all for that.

  • Charles Afford 1163 posts 1709 karma points
    May 05, 2014 @ 17:17
    Charles Afford
    0

    Ok so the flat file is like in CSV that you parse and then create a new member based on that?

    Have a look at:

    http://www.charlesafford.com/blog-folder/umbraco-members-and-aspnet-membership-provider-1/

    I wrote it a while ago but you will get the basic jist of how to set data on custom properties.

    Are you trying to save the data on a member group?  You should be setting it on a member?

    Charlie :)

  • lucuma 261 posts 563 karma points
    May 05, 2014 @ 17:22
    lucuma
    0

    Sorry, Monday morning. Each employee can be associated to one or more job id's (another feed) and those are sycning to member groups. I wanted to associate the member group to the job id (not the member's I miswrote). There is no need for a lookup table for members as the username is set to their id but in the event in the future a Job changes I need to be able to associate them based on id's.

  • Charles Afford 1163 posts 1709 karma points
    May 05, 2014 @ 17:36
    Charles Afford
    0

    Its fine :).  I dont think you can set property values of groups only members.  

    In my mind what i would suggest i having a text property on the member.  Add the jobids as comma delimited values into the text property.

    When you need to look up the properties just parse the comma delimited values.

    Other than that you could create a new table in the database, setting up a stored proc and then retirve the values from that.

    custom sql table seems to be the most approite?

    Charlie :) 

  • lucuma 261 posts 563 karma points
    May 05, 2014 @ 17:40
    lucuma
    0

    That's essentially what I'm doing now. Syncing jobs to roles based on name (they are unique) and then creating a lookup table to match job id's to role ids. When I sync the members I just associate/deassociate groups based on job's.. I appreciate your feedback.

  • Charles Afford 1163 posts 1709 karma points
    May 05, 2014 @ 17:45
    Charles Afford
    0

    Ah i see we are getting are wires crossed i think.  Yea that seems a pretty good way of doing it :).  When you said lookup table i did not realise you meant database, although come to think of it i m sure what else you could have been referring to :').  No problem glad i could help :).

    Charlie.

Please Sign in or register to post replies

Write your reply to:

Draft