Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Setting Custom Profile Values on a chiild portal from portal 0Setting Custom Profile Values on a chiild portal from portal 0
Previous
 
Next
New Post
3/10/2015 7:04 PM
 

I have code for setting values into several custom properties.  The code works on child portals for the user role intended.

The custom properties are for who donations are paid to for a fund raiser (created on a child portal) .  That is, the child portal is the fund raiser and these are made programmatically by persons in a Sales Rep  Role or Admins.

When portals are made and the Chair Person is set up and they will run the fund raiser on the portal.  Obviously they're in a given role.  When the module for setting these properties is used on the child portal  they can set/get them.  But we asked ourselves what if this Pay To info  is available at sign up time?  Why not put it in then?

The settings do get created.  But when we try to write to them from Portal 0, just after creating the portal, the chair person and the custom properties, it isn't working.  Here is the method ultimately called, with skin message entries before and after the Set properties.  The txtPayToName and txtPayToAttnTo are arriving in the method.  The set properties code works when this module is used from a child portal for a user in the role for Chair Persons.

 I'm thinking it's an environment thing.  When the user gets created, their profile is set up at time of portal creation those properties are set.  The custom properties, from what I know, have to be created after the portal itself is.  But apparently they cannot be populated from Portal 0, only from the portal for which they're set up?

If that conclusion is right, is there a way to code around it?

 Thanks!

    public void AddChairPayToInfo(UserInfo ui)
    {
        if (ui != null)
        {
            PrivateAddChairPayToInfo(ui);
        }
    }

    private void PrivateAddChairPayToInfo(UserInfo ui)
    {
        DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, "", "Prior to setting profile, user and portal are: "
    + ui.Username + "  " + ui.PortalID.ToString()
    + " Pay To Org and Person are: "
    + txtPayToName.Text
    + " and "
    + txtPayToAttnTo.Text,
ModuleMessage.ModuleMessageType.BlueInfo);

        //The basic profile property values
        ui.Profile.SetProfileProperty("PayToName", txtPayToName.Text);
        ui.Profile.SetProfileProperty("PayToStreet1", txtPayToStreet1.Text);
        ui.Profile.SetProfileProperty("PayToStreet2", txtPayToStreet2.Text);
        ui.Profile.SetProfileProperty("PayToCity", txtPayToCity.Text);
        ui.Profile.SetProfileProperty("PayToState", txtPayToState.Text);
        ui.Profile.SetProfileProperty("PayToZip", txtPayToZip.Text);
        ui.Profile.SetProfileProperty("PayToAttnTo", txtPayToAttnTo.Text);
        ui.Profile.SetProfileProperty("PayToPhone", txtPayToPhone.Text);
        UserController.UpdateUser(ui.PortalID, ui);
        DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, "", "After setting profile, user and portal are: "
    + ui.Username + "  " + ui.PortalID.ToString()
    + " Pay To Org and Person are: "
    + ui.Profile.GetPropertyValue("PayToName")
    + " and "
    + ui.Profile.GetPropertyValue("PayToAttnTo"),
ModuleMessage.ModuleMessageType.BlueInfo);

    }

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Setting Custom Profile Values on a chiild portal from portal 0Setting Custom Profile Values on a chiild portal from portal 0


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out