+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Assigning Custom Tag to a Custom profile

Assigning Custom Tag to a Custom profile

1 posts, 0 answered
  1. Darrin Robertson
    Darrin Robertson avatar
    105 posts
    Registered:
    18 Jul 2004
    08 Dec 2013
    Link to this post
    Can anyone help me out.

    I have a custom classification named "Disciplines" which is a flat taxon.
    I also have a custom profile type named "contractor" which has been assigned with the custom taxon Disciplines.

    In code, how do I assign one of the taxons to the profile field???

    I can get the custom profile and assign a value to the ContactNumber field just fine via the below code.
    (This is from a initial create user method thus the use of CreateProfile method)

    var profName = UserProfilesHelper.GetUserProfileTypeNames().Where(u => u.Contains("contractor")).SingleOrDefault();
     var userProfile = profileManager.CreateProfile(user, profName);
     userProfile.SetValue("ContactNumber", ContactNumberTextField.Value.ToString());

    I can get the Taxon via
    var taxon = taxManager.GetTaxa<FlatTaxon>().FirstOrDefault(s => s.Title == "Disciplines");

    But how do I assign one of the taxon's, for example "Generalist", to the Contractor custom profile?

    Any help would be appreciated.
    Thanks
1 posts, 0 answered