Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Hot answers tagged

37

The error happens when you're trying to insert/update the record which can't be logically inserted/updated. So basically make sure that: you don't insert/update a record that does not exist, you don't update object field that is build-in/read-only, you perform the action using the user who has not the right access to modify the object More detailed ...


11

Go to: Setup -> Customize Communities -> Manage Communities Then press the 'Edit' link left of the Community Then add the profile/permission set to the Members using the 'Members' button at the top left of the menu.


10

According to the license documentation: http://login.salesforce.com/help/doc/en/users_understanding_license_types.htm "Users with this license have read and create access on ideas and questions and answers, and read-only access to documents, knowledge, price books, and products" - plus you can access custom objects. I'm surprised that you can insert an ...


9

Anonymous (unauthenticated) users always show as "logged in" as the Guest User; authenticated website users always show as the actual authenticated user. If you are only seeing activity from the Guest User, you are not authenticating correctly, or you have not properly set up your Sites instance to accept logins via a portal user. If you are doing it ...


6

As mentioned, these have all been subsumed into Community, the portal to rule them all. For the curious, here's the lineage. Self-Service This was the very first portal. It's main draw is it's FREE. User management is funky (not stored in the User table), and customization is extremely limited. Partner / Customer Portal These are the second portal ...


5

There is another possibility, assuming that the the Visualforce page is listed as one of the Site's Visualforce pages. If you are already authenticated, but you request the page over a non-secure connection (http) it will show up as the Site's Guest User. You can see how this works pretty easily. Authenticate and go to an https page. https://mydeveloper-...


5

That should be possible, indeed. You can recompose the URL and forward a user to it when clicking on a custom button. If you hover over the 'Log in to...' option and right-click, there will be an option to copy the URL or link. Copy it and paste it to a text editor. It will look similar to this: javascript:navigateToUrl(%27/servlet/servlet.su?oid=...


4

Word of caution to you... Is it OK for the users to see the secure.force.com domain in the URL? If you want to allow users to log in then you have to expose that to them. There is no way around it. Force.com sites and Customer Portal do NOT support custom SSL certificates. It is on the roadmap, but who knows when it will be delivered. I'd hope that it ...


4

I'd discourage Portal creation other than in Dev orgs - any new Portal developmnent should stand on the shoulders of Communities instead. If you replace Portal with Community, a lot of the existing documentation holds true. Also watch out, I don't think you will get a Portal or a Community to live on your Salesforce domain. Which one of these portals ...


4

Have you looked into any of the security documentation about the platform yet? Organization wide defaults will dictate how locked down your object model is, so you'll want to ensure that that particular object type is set to Private. https://help.salesforce.com/HTViewHelpDoc?id=admin_sharing.htm&language=en_US


4

A PartnerNetwork is part of Salesforce to Salesforce. You need to Enable Salesforce to Salesforce in your org. Edit From the Object Reference for Profile: UserType: PRM: user whose access is limited because he or she is a partner and typically accesses the application through a partner portal. Label is Partner. In your situation, this would apply ...


4

The Authentication Service section in My Domain shows up the SSO configurations only if SAML is enabled in your Org and that My Domain is deployed. Refer to the below excerpt from the documentation for Add Identity Providers to a Login Page (emphasis mine): If you’ve enabled single sign-on and configured SAML, or set up external authentication providers ...


3

You could configure this (never displayed page) as the landing page: <apex:page controller="RedirectController" action="{!redirect}"/> where its controller makes the decision about which page to display: public with sharing class RedirectController { public PageReference redirect() { // Query the profile ids // Return the ...


3

Salesforce already provides a way to see if a case is related to a self-service user. In the self-service portal settings you can select a case origin (the default is 'web') and as long as this is unique you know that any cases with that origin were created from the SSP. Furthermore, there is a 'visible in SSP' field on the case that tells you if SSP users ...


3

I found some further information here: Provisioning Customer Portal Users with Apex This post suggests that the problem is that you cannot create a contact and a user record in the same APEX transaction. Doing so is called mixed DML and is not allowed. Therefore if you must create a contact and user at the same time the only way to do so is for one of them ...


3

Here is a fairly new article that describes this and check the comments section also for common mistakes and fixes. http://blogs.developerforce.com/developer-relations/2013/02/oauth-for-portal-users.html The URL needs to be: https://mysite.secure.force.com/services/oauth2/authorize?response_type=code&client_id=<your_client_id>&redirect_uri=&...


3

When you're creating the contact and accounts for the portal user in your test they're going to have whoever's running the test or whichever user is specified in a system.runas() block. The key is to make sure that user has a role and then you should be fine. It's best to create a user in your test for this and then put the portal user creation inside a ...


3

To enable the accounts as partner accounts, set the 'IsPartner' field to true after creating the account (it cannot be done during creation, only by update). Account partnerAccount= new Account( Name = 'theAccount', ); Database.insert(partnerAccount); partnerAccount.IsPartner = true; update partnerAccount; Next step is to add the contacts/users. I ...


3

Just as with a production instance of Salesforce, Users cannot be imported or loaded as data into a test class. Instead, you need you'll need to create them programmatically. You could load their contact info and presumably any other details you might need from their profile (including the profile Id, assuming it matches your org) to create them. But, you'...


3

I was able to resolve the issue by adding 'without sharing' to all my framework classes which leads to create the portal user.


3

The Opportunity Object isn't available to customer community users for create, edit, read or delete. See Communities User Licenses for more on what objects are exposed depending on which license you choose. The only way you could expose the specific fields would be to mirror them to a custom object and share the custom object. In doing so, I need to caution ...


2

There isn't one. Customer Portal Roles (as well as Partner Roles) are stored in the UserRole object. The PartnerRole object is picklist definition object which defines the values for for AccountPartner.PartnerRole, much like OpportunityStage does for Opportunity.Stage. To distinguish between regular, partner portal, and customer portal roles filter on the ...


2

Can you explore the Site class methods? I don't have Portal handy to test but Site.getName() returns null in regular "Execute Anonymous" window so it seems to be a good starting point. Maybe something like Boolean isAuthenticatedContext = String.isBlank(Site.getName()) || Site.isLoginEnabled() || Site.isRegistrationEnabled(); (no idea what do these last 2 ...


2

It's because it's kinda complicated and it may move around as they gauge customer response. For partner communities, there is a named user model that pretty much follows the older partner portal pricing. But they also have a logins/month option (something you used to only see on customer portal) for orgs with larger numbers of infrequent partners. And ...


2

I don't think you need it. Salesforce says: The portalID value may be null or an empty key if there is no portal configured with this provider. In the example provided by Salesforce, which I have partially provided here, they don't provide the portal Id: static testMethod void testCreateAndUpdateUser() { StandardUserRegistrationHandler handler = new ...


2

In your test class. You can't assign Id to any sobject. Id generates after insert operation happens. So you need to remove below line. contactToInsert.Id = [SELECT id FROM profile where Name = 'Customer Community - On Hold'].Id; And store profile Id in another variable Id profId = [SELECT id FROM profile ...


2

The following works in my org with regards to a Partner Portal (Legacy) Not sure exactly what type of portal you are using but this passed for me: Account OWD Private - Profile has read, create, edit on account Test class @isTest private with sharing class PortalCheck_Tests { private static testmethod void basicTest() { User u = [Select ID ...


2

I think, sharing the accounts with Portal user won't give them access to related contact. Account - Contact are not exactly master-Detail relationship. (You can create a contact without Account). You can enable the external sharing and pick controlled by parent. I believe , this would work and allow user to see contact if they see account. I have done and ...


1

You should go with communities unless there is specific functionality that is only provided by a portal. Portals are now old technology and won't be getting any enhancements, as Salesforce are now focused on communities. Also, if you don't currently have a portal, you can't buy portal licenses. Only companies with older orgs that already have customer or ...


1

After digging through the debug files on user registration and a call to BMC it turns out that remedyforce has a default on option that automatically fires a password reset in a trigger for all new users, totally disregarding any options set through standard ui or the api. Still quite miffed over this.


Only top voted, non community-wiki answers of a minimum length are eligible