I would like to remove the standard "Save & Add Price" Button from the new product page layout IF the product is of a certain record type. How would I achieve this?
This is not going to be trivial
- Create a VF page that overrides the New button for Product. Create a corresponding controller extension class.
- Include all the fields that your users would get for free from the standard page layout. Mimic the required fields that the standard page layout supports. As new Product2 fields are added, you will need to maintain this VF page too. Fieldsets can make this somewhat easier.
apex:commandButtonfor each of the OOB buttons -
Save & Add price, and
Cancel. There is no
URLFORexpression you can use for the
Save & Add Priceaction so you will have to use the controller to do the redirect via an action method as the URL requires the Product2 ID:
- Dynamically display the
save & add pricebutton depending on Record Type by using a
rendered=attribute on the