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
Glenn at MvistaGlenn at Mvista 

Segregating Product "edit" and product "activation"

I was wondering if anyone has encountered and possibly solved this.  I cannot segregate responsibility for product marketing to ONLY edit and create products.  I do not want them to be able to make them "Active" but removing the Active field from the page layouts is not sufficient.

 

You cannot set the field itself to Read only for a profile and you cannoy get ride of the Activate/Deactivate links on the View layout.

 

Any ideas?

Best Answer chosen by Admin (Salesforce Developers) 
Glenn at MvistaGlenn at Mvista

stwdev wrote:

>However, you should be able to create a Visualforce page to override the List View under the Product tab. If you control that page, you control whether or not the Deactivate/Activate links appear.

 

This looks to be the best way, thanks!

 

All Answers

stwdevstwdev

How about using a validation rule to prohibit users of a particular profile from setting Active to true?

 

Rule NameMarketingUserCannotActivateProductActiveChecked
Error Condition FormulaAND($Profile.Id = '00eA0000000QVfx', IsActive )
Error MessageMarketing Users are not permitted to activate productsError LocationActive
Glenn at MvistaGlenn at Mvista

Nice idea, but the results are the same as with the read only field.  The Activate/Deactivate button still overrides this.

stwdevstwdev

ok - we're actually talking about two functionally different things here.

 

The Deactivate/Activate links are actually controlling the Active checkbox on the PriceBook. This is different than the Active checkbox on the Product itself. And, unfortunately, there is no way to configure page layouts or field level security and so forth on PriceBooks.

 

I'm guessing that controlling the Active checkbox on the PriceBook is really what you're after.

 

I don't think you're going to be able to solve this problem completely using declarative means. However, you should be able to create a Visualforce page to override the List View under the Product tab. If you control that page, you control whether or not the Deactivate/Activate links appear. You'll also need to override the Product Edit page as well so you can control how prices are presented to the user.

 

I'd be inclined to write my own logic and UI for creating/editing products and prices. Admittedly, that's more work than should be needed to meet your requirements.

 

Please consider posting an idea on ideas.salesforce.com to add support for this use case. There are several things you could ask for, but I think getting configuration capabilities on Price Books would probably do the trick.

Glenn at MvistaGlenn at Mvista

stwdev wrote:

>However, you should be able to create a Visualforce page to override the List View under the Product tab. If you control that page, you control whether or not the Deactivate/Activate links appear.

 

This looks to be the best way, thanks!

 

This was selected as the best answer