Tag Archives: salesforce custom button

Wedid: Automate Installation Job from Closed Opportunity


The business organisation runs an electrical appliance shop. The typical sales cycle for this business includes:

  • sales to convert leads to account/opportunities
  • sales to close won successful opportunities
  • coordinator to receive a notification from sales
  • coordinator to manually create an installation record (custom object) and link to the closed won opp to track on the status
  • coordinator to manually update the installation status back to opportunity upon completion

Some additional challenges,

  • the coordinator must not see all data related to the sales figures for the opportunity
  • the coordinator only has Force.com App Subscription license (no access to Opportunity object)


  • Create separate data model for job installation
  • Automate the job to create the installation record via a button ‘Create Installation Job’
  • Provide validation to ensure only one installation record is created per Opportunity

Related Objects Opportunity, Custom Object
Components Apex Trigger, Apex Class, Visualforce Page, Custom Button
Complexity Medium

Wedid: Implementing Page Wizard


The business organisation runs a Gym service centre. Customers have to pre-book their gym activity in advance so that the classes can be arranged. It uses Salesforce to track the following details:

  • customer health status in a custom object
  • type of classes with health hazard identifier in a custom object
  • schedules for the classes in a custom object that links to the classes

To enroll a member to the class, the Salesperson needs a page view wizard. This page wizard allows one glance view to all the related (parent-child) information needed for enrollment. Without the wizard, it proves difficult for the Salesperson as he needs to switch between object displays to get complete information. And these steps need to be repeated as it involves enrolling a member in many different classes.


  • Page wizard to display all information in a one glance view
  • Saves time for the Salesperson and efficiently enroll members

Related Objects Contact, Custom Object
Components Visualforce Page, Apex Class, Custom Button
Complexity Medium

Wedid: Cross Object Page View With Extensible Filters Via Custom Button/Tab


The customer runs a flower shop that includes delivery service. Getting complete information of the buyer and sales order are important so that the goods are sent at a timely manner.

At the end of the day, the customer needs:

  • extended filter such asĀ filter by client, order delivery date, order salespersonĀ for specific records
  • to mass update records with unfulfilled information by inline editing
  • the displayed record to be sortable
  • the above execution to be accessible via a click from a custom tab or custom button from the object with filter options


  • Provide extensible filters for cross objects
  • Mass update records via inline editing
  • Access page by a single custom button/tab
Related Objects Opportunity, Account, Custom Object
Components Visualforce Page, Apex Class, Custom Button
Complexity Medium

Salesforce: Restrict Button Execution

If you have a button in a page layout and you only want Administrator to see it, how can you do that?

Option #1: Page Layout

Use different page layout for different profile. Show the button only in Administrator page layout

Option #2: Visualforce

You can create a validation at your controller and check for the user profile before executing any logic

Option #3: Javascript

You can write Javascript in a button that gives you the following functionality.

This would be a quick workaround if you are using Professional edition and do not want to develop any Apex code. However, this validation is a Javascript code from client browser, if the user has the link or change their HTML client behavior, they will be able to by pass this.