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
nagennagen 

How to disable a button depending on activity being completed

Hi,
I would like to know how to disable a button depending on activity being completed.

For Instance, I have an application that has two button
1. Print orginal (document)
2. Print duplicate.

Once the "Print Orginal" is clicked, it prints a report and inserts a value/flag  in the database and the "Print Orginal" should be disabled after this.
Users should be able to print only using the "Print Duplicate" button.

Thanks in advance
Nagen.
BunnyBoyBunnyBoy
If you have record types available in your org, that would be one possible solution.  Create two page layouts, one with the "Print Original" button and one without, and assign them to different record types.  Once the "Print Original" button is selected, update the record type along with the other value, and users would no longer have access to the "Print Original" button.    
nagennagen
I am sorry for asking this, I am new to Salesforce.

What are record  types and how do I Update the record types?

How would I know if my org has record types

Is there some documentation on record types?

Thx.
n

BunnyBoyBunnyBoy

No problem.  If you are on enterprise or unlimited editions, you have record types.  I don't think they are available in professional.  Go to Setup-> App Setup -> Activities (if those are the objects you are trying to customize.)  If you see Task Record Type and Event Record Type links, you should have what you need. 

In short, record types are the means Salesforce gives you to show different page layouts to users for the same object type.  This would allow you, for instance, to have one Task page layout with both of your buttons, and one layout with just the Print Duplicate button, and Salesforce would display the appropriate page based on the value of the record type field. You set the record type much like any other related field such as Account, either through the UI or the API.  

For more information on how to implement record types, you can search for What Are Record Types in the Salesforce help content and download the cheat sheet attached to that Solution.