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
TzafrirbenTzafrirben 

Create a Customer Portal User

We need to create a cusomer portal user from a .NET code and not from Apex (so we cannot use the Site.CreateCusomerPortal method in Apex).

 

For some reason, when trying to create new user from the .NET API we keep getting the following error:

invalid cross reference id (Status code INVALID_CROSS_REFERENCE_KEY)

 

 

Any ideas\examples on how we can perfrom this task and why we keep getting this error?

indy_sfdcindy_sfdc

Do you have any sample code you are using?

 

If I remember correctly among other things you need to associate the User to a Contact, set the correct profile and set the AccountId on the user record.  I am not certain but a conflict with the Account and Contact could give this type of error. 

 

Another option you could use is to create an APEX Web Service and call that service from your .NET client to create your user.  Later you would have APEX code that you could re-use if you were to need that common function within APEX or a new client based applicaiton, just a thought. 

Ali NAli N

Hi,

 

Have you had any luck with that. I am going to do the same - creating a customer portal user using WSDL . Net.

 

Thanks