function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nabil711nabil711 

Updating account using customer portal

Hi

 

I get this error message

 

caused by: System.DmlException: Update failed. First exception on row 0 with id 001f0000001uqh7AAA; first error: INVALID_FIELD_FOR_INSERT_UPDATE, Account: bad field names on insert/update call: Name: [Name]

 

Erreur dans l'expression '{!enreg}' du composant <apex:page> dans page vfp_edit_account

 

public PageReference enreg_v2()
{
  update account; 
  PageReference pageResult = new PageReference('/apex/VFP_Moncompte_V2');  
  pageResult.setRedirect(true);
  return pageResult;
}

 

Thanks

SFFSFF

You can't (normally) insert or update into Account from the customer portal. This makes sense when you think about it - customer portal licenses are linked to the Account, after all.

 

I was able to create a custom VF page once upon a time where the controller was defined as without sharing.  Once I did that, the customer's administrator was able to update their Account record directly. Obviously, I didn't let them change key fields like Name but I figured if anyone knew when their phone number or address was going to change, it would be the customer's administrator.

 

Good luck!