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
PProkesPProkes 

Mandatory custom button based on field data

When a user enters an amount equal to or greater than $125,000 in the "Amount" field on the "Opportunity" page, how can I make a Custom Object button (currently named "New Residual Request") mandatory for that opportunity?

b-Forceb-Force

As per my understanding,

you are trying to show/Hide one Custom Button on opportunity page Layout

 

If yes following is solution for your problem.

 

By using standard functionality,  we can not show/hide any button based on the record data .... As we can not add any code in PageLayout :(

 

Following is workaround for your problem:

As we can assign different Pagelayout based on the object record type, What you can do change record type of your Opportunity When Amount will cross your criteria.

 

Steps:

  1. Create a New record Type ..Say 'MillionOpp' on Opportunity object
  2. Create a new pagelayout using ...place which component you want on it including button,
  3. Assign this layout for above record type
  4. Define a Workflow ..which will fire when Amount will be greater than 125000,[Every time record create/edit]
  5. Add one Field Update ---->Change the record type of Opportunity to 'MillionOpp'
  6. Autometically new Layout with "New Residual Reques"  get assigned to Opportunity
  7. Do Vice versa when amount will less than 125000 change record type to Original one  , using Workflow and Field Update combination

 

 

This is tested solution, Hope This will help you. If it works for you mark this post as solved

 

Thanks ,

Bala