November Happy Hour will be moved to Thursday December 5th.

Error when editing a Contact that was created from code (Commerce 11.7.3)

Vote:
 

I'm getting this error when clicking on the Name (not edit pen icon) from my list of contacts, ONLY if that contact was created from code.  We have an import script and a registration page where contacts are created via code. 

Is there any way to debug CM to resolve issues like this?  - I'm at a loss

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Mediachase.Commerce.Customers.MapUserKey.ToUserKey(String typedUserKey) +111
   Mediachase.Commerce.Customers.CustomerContext.GetUserForContactId(PrimaryKeyId customerContactId) +146
   Mediachase.Commerce.Manager.Apps.Customer.CommandHandlers.SecurityRoleAssignmentEnableHandler.IsEnable(Object sender, Object element) +104
   Mediachase.BusinessFoundation.XmlFormBuilder.CheckBlockVisibility(Block block) +530
   Mediachase.BusinessFoundation.XmlFormBuilder.GenerateMenuItem(Block block, Int32 level) +155
   Mediachase.BusinessFoundation.XmlFormBuilder.BindBlocks(Form form, Int32 firstTabBlockNumber) +458
   Mediachase.BusinessFoundation.XmlFormBuilder.GenerateStructure() +757
   Mediachase.BusinessFoundation.XmlFormBuilder.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +24
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +67
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +128
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +34
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   Mediachase.Commerce.Manager.Apps.MetaUIEntity.Modules.EntityViewWithButtons.Page_Load(Object sender, EventArgs e) +593
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678
#211360
Edited, Jan 04, 2020 1:33
Vote:
 

How did you create the contact?

#211361
Jan 04, 2020 9:29
Vote:
 

Hi Quan, 

As I looked closer at the code I found that this line was causing the issue as it needed an upper case 'S' in String 🤦‍♂️

this._contactEntity.UserId = "string:" + email;

Thanks,

Ben

#211382
Edited, Jan 06, 2020 18:46
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.