dotnetnuke-9dotnetnuke

It is possible to create a ProfilePropertyDefinition with PortalID NULL?


I have been using this code for create ProfilePropertyDefinition:

ProfileController.AddPropertyDefinition(new ProfilePropertyDefinition(objUserInfo.PortalID) { PropertyName = propName, PropertyCategory = propCategory, DataType = 2, ReadOnly = false });

objUserInfo.PortalID is an int so I cant pass null here.

There is another way to create a PropertyDefinition with PortalID NULL?


Solution

  • This is not a supported process in the API as the actual profile information is associated on a per-portal basis.

    DB architecture would allow it, but you would be going around the DNN API's to actually insert the values. Additionally, the DNN API would not extract the profile information for the user as it always uses the portal ID values.