Wedid:Salesforce Create Monthly Opportunity Automatically on Subscription Duration


The company sells product base on monthly subscription. There is a challenge for them to forecast their monthly revenue base on Account Industry.

At this moment, Salesforce only supports forecast by users or by products. In order for the forecast to work accordingly (by Account Industry), user has to manually create a series of opportunities base on the contract term of subscriptions


Custom Trigger on Opportunity object. This trigger will relate the opportunity to the respective budget and, at the same time, automatically creates a series of related opportunities based on the contract term of subscriptions.

For example, If the term is for 2 years, 24 related opportunities will be created. Users are able to see the forecast revenue over a report which lists out all the related opportunities by month.

Related Objects Opportunity
Components Apex class
Apex trigger
Complexity Low

Wedid: e-Survey form (iPad compatible)


Filling up physical forms is time consuming. To add in the pain, users are required to carry out some calculations. They will have to manually calculate any figure related info using an external app or device (e.g. “the calculator”) and fill up the result values into the right column in the form itself. This will clearly open up to a lot of calculation mistakes and data discrepancies in results. Physical forms will have limited info for reporting as well as the linkage between the related info are pretty vague.


We replicate the whole form into Salesforce by creating a custom object that holds the required information. Creating a record in Salesforce now has replaced the need to fill up the physical form manually and the information can be linked to any relevant records (e.g. Account). Filling relevant information can also be done using mobile device e.g. iPad or a tablet.

We have implemented a series of workflows, validation rules and  Apex triggers to do the following:

1. Workflows to populate certain values on form completion.

2. Validation rule ensure certain fields are filled up before completing the forms.

3. Triggers to handle complex calculation logic and alerts.

Related Objects Custom Objects
Components Workflows, Validation rules, Apex Triggers, Apex Classes
Complexity Medium

Salesforce: License Key Automation


User have to manually assign license keys to the related software in Opportunity Line Item whenever the opportunities are closed as won.

The process involve users going in to the license keys object and look for the available license key. They have to manually populate the software info into the assigned license key records as well.


Create a trigger that allows users to assign license key to the related software automatically by a button click. The solution covers:

  1. Listing out the software in Opportunity Line Item that will go through the license key assignment process. From the list, users have options to proceed or cancel.
  2. If proceed, the license key assignment process will start.
  3. In the assignment process, the trigger will search for the “Available” license key based on the type and version of the software. Once the list of available license keys have been found, one license key will be selected and assigned to the software. The software details will be populated into the assigned license key and the status of the licensed key will be set as “Not Available”.
Related Objects Opportunity and Custom Object
Components Apex Trigger, Visualforce
Complexity Complex

Salesforce: Convert All Duplicate Leads


Most Salesforce has more than one channel where Lead can be created. That is why it is common to have duplicate leads. You can use the “Find Duplicate” button but you will need to click on each record one by one.


Determine a common pattern to recognise duplicate lead. For example: Email address. Create a trigger that does the following:

  1. A Lead is converted to an Account and a Contact
  2. The trigger can then search the Lead database for other records that share the same email address
  3. Convert all the duplicate leads and merge them into the Converted Account and Contact
Related Objects Lead
Components Apex Trigger
Complexity Medium

Salesforce: Maintaining Case Creator Access After Assignment Rules


Fred is a Salesforce User. Fred goes into Salesforce and create a case and check the checkbox “Assign using active assignment rules”. Once the case is created, the assignment rules kick in and Fred (the Creator) has no longer access to this case.


When the Case sharing rules is set to private, by default, only the owner has the access to the case. If the assignment rules change owner to John. Fred will no longer have access to the case.


Simple workaround is to manually add Fred into sharing rules. If you want to automate that, you can write a trigger to do so. However, if you are referring to the execution order here:

3) Executes all before trigger.

6) Executes all after triggers.
7) Executes assignment rules.

11) If the record was updated with workflow field updates, fires before and after  triggers one more time (and only one more time)…

Both before (3) and after (6) triggers execute before the assignment rules. You must run the auto-sharing trigger at step (11)


Salesforce as a Subscription Billing System Part 2

We talked about how Salesforce can turn into a Subscription Billing System in our previous blog post and illustrate how a standard full month subscription items can be recorded automatically.

Apart from handling the standard full month subscription, it should be capable to handle pro-rata scenario too. This is important as not every subscription starts from the first of every month and customer should be credited appropriately.

Imagine that a customer subscribes to your services/products in the middle of the month (i.e. 13th Mar 2013). The first month should really be charged from 13th until 31st Mar instead of the full month. And so the final month of the subscription that the customer too should be charged accordingly.

To find out in more details on how can the pro-rata scenario can be handled in Salesforce, feel free to check out our recently published case and contact us for more information.

Populate Additional Info to Activity

In Salesforce, if a user creates a task or an event from a lead or a contact, only the phone number of the lead / contact will be populated over (Figure 1).

But, at times we need more information to be populated over instead of the phone number only as certain additional information may be deemed useful and relevant when scheduling appointments with leads and contacts in Salesforce.

This is also a plus point feature for the other invitees of the event who needs to view the additional information without having to navigate to the related lead or contact records.

Unfortunately, you can not achieve this additional field population function by using the Salesforce standard formula fields or workflows. Formulas and workflows do not work with the WhoId and WhatId in Activity.


In Salesforce Activity object:

  1. Create the relevant fields for the data population.
  2. Develop a trigger to populate the additional information from leads/contacts to tasks or events. Ensure that the fields are match correctly for the data population

For more information on the technical specs, check out our new published case here.

Salesforce Dynamic Form Population

Use case:

One of the daunting task for the sales reps in Company B is to manually fill up application forms for their clients nearly everyday.

This situation gets more tasking when sales reps have to fill up the same details of the same clients (e.g. name, date of birth, address) repeatedly for every new service engagements.

Certain information are filled in different sections and columns of the application form depending on the type of services that their clients are engaging to (Table 1).

The initial solution is to use a template generator to pull out the data from their Salesforce instance and generate electronic forms.

The client details are already in Salesforce. However, the complexity is noticeable when these details are segregated and stored in different objects.

 Service Type  Section 1  Section 2  Section 3
 Service 1  
 Service 2  
 Service 3  
 Service 4  
Table 1


  1. Install template generator. Create a button to generate an electronic application form from the targeted object (e.g. opportunity).
  2. Create fields in the targeted object similar to the ones in manual application form.
  3. Create a trigger to get and populate all the relevant client details from different objects into the respective fields created.
  4. Map these fields into the template generator. The template generator will get the values from the fields and display them in the electronic application form (pdf, word doc, etc).

The trigger created will have the capability to find and map data based on the service type that the user selected in the targeted object.

For more information on the technical specs, check out our new published case here.

Salesforce: Mass Email Target Users Upon Event Meeting Completion

In Salesforce Event calendar, the organiser is allowed to extend the event invitations to other user contacts and leads. Once the event is created, the recipients will receive email related to the event details. The recipients will eventually respond to the event indicating if they will accept/decline the invitation.

Many users find this event notification useful as they can keep the related contacts in the loop on the event details. However, there are scenarios where the contacts involved do not necessarily need to attend the event. They only want to be informed of the event final details upon completion. Using the existing feature will result in:

  • the related contacts having unresponded meeting invitations
  • receiving other unrelated event notifications

In this case, we have created Apex code to allow mass email event to target users with customised email body upon event completion. The customised email body will contain informative details enlisting the event invitees who are the real event audience as well as the event notes. Ultimately, the contacts will:

  • only receive emails that is of relevance
  • informed of event notes upon completion

The following is a snippet on how the requirement is achievable:

Check out our page here for details about the technical specs.