- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
10-21-2011 01:15 PM
eatePortalUser(SObject, String, String) 20:07:39.044 (44986000)|FATAL_ERROR|System.TypeException: That operation is only allowed from within an active site.
After attempting to create a portal user im getting this error.
I'm running the code in a @future static method, because if i ran the code inside a method of my class it always returned null and no errors but it did nothing.
I was wondering when this error occurs (obviously i checked and my site is active) is it because im running the code in a @future method? If so, how can i register a new user for my customer portal? I've followed the tutorial on Authenticating User on Force.com SItes, but i've had no success.
After trying for 2 days to figure out whats wrong i decided it was time to seek help.
11-02-2011 08:44 AM
The method site.createportaluser() returns null if one is creating a customer portal user internally (i.e. the code is not running on site). This method viz- site.createportaluser() method works only via sites for the purpose of creating a portal user. Hence please ensure that you are creating a portal user through sites only.
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.