You need to sign in to do that
Don't have an account?
Adriana Smith
Need to hide "create new opportunity" button from certain profiles...
I need to find a way to keep certain users from creating new opportunities, thereby only being able to create them by converting a lead. We have a sales process that starts with lead creation, and it completely throws off our metrics when an opportunity is created directly rather than through lead conversion. That being said, one team SHOULD be able to do create directly (even if it's only from the 'clone' button). SF support said I need custom code for this and I've no clue where to start. Any help would be appreciated.
Best,
You can hide the New button functionality at the Profile Levels of these users.(only if all these set of users belongs to a single profile).
Go to Profiles - Click on Object Settings - Opportunities - Edit - And Check the Read checkbox.
Please let me know if it solves your query.
Rgrds,
Rabi
As Shalabh mentioned, you cannot hide the standard 'New Opportunity' button while the profile has access to create opportunities. The simplest option that I can think of would be to use a validation rule on the opportunity object that is met only during lead conversion (I can't think of an easy way for this). The validation rule can be flexible to fire only for specific profile groups so you can allow opportunity creation for some groups of users.
Last option - Code. You can remove the ability of the profiles to create opportunity records and have an apex trigger which creates the opportunity record when a lead is converted. This will give your desired outcome but comes at a cost of introducing some code elements to your lead conversion process which will limit flexibility in future.
Returning to a topic that probably should be resolved by now...
An easy way to do what Jerun and the Salesforce Enforcer were suggesting is to just have a field that is always populated on the Lead and map it to the Opportunity. We do something similar and it looks like this:
- Create a custom formula field on the Lead called Lead_Conversion_Id. The formula can simply be "Id" since the Id will always have a value for every lead.
- Create a text field on the Opportunity called Lead_Conversion_Id, then go back to the Lead Conversion Mappings and map it. Make sure that this field is not visible to the users you don't want creating Opportunities from scratch so that they can't fill it in when they try.
- Create a validation rule on the Opportunity that looks like: ISBLANK(Lead_Conversion_Id), which returns an error. Our error tells the user that to keep data consistent, they must create a lead first and then convert it to a loan.
This will make it so that users can't create an Opportunity from scratch, but can create one from a converted Lead. Yes, it is rather annoying the first time or two because you don't get the error until after you enter the information and click "Save", but users will quickly catch on.Thanks for this logic. Question for you. As you laid it out, the validation rule will prevent everyone in the org from creating an Opportunity from Scratch. Like the original question above, we only want to prevent Partner Portal users from creating Opportunities from Scratch, but allowing them to create when converting.
How would I update the Validation rule so that this only applies to Partners (I'm guessing we could use a restriction of IF( $Profile.UserType = Partner...), but allows our internal users to create opportunities from scratch.
What would the validation rule look like for this?
AND(ISBLANK( Lead_Conversion_ID__c ), ISPICKVAL($Profile.UserType, "PowerPartner"))
The formatting of the date formula is as follows..
AND(
ISBLANK( Lead_Conversion_Id__c ),
DATEVALUE (CreatedDate) > DATE (2021,10,11))