[SalesForce] Cloning opportunities – identifying which deals are “clones”

Suppose that at the end of each fiscal year, existing opportunities within Salesforce are "cloned." Over the course of the fiscal year, entirely new opportunities are created. So for a given fiscal year, two types of opportunities are present: 1. deals that are new to the database and 2. deals that are clones from the prior year.

Two questions:

  1. In looking at all opportunities associated with a given fiscal year, is it possible to identify which ones represent "clones" from the prior year?

  2. In cloning opportunities, is it possible to create an indicator that indicates the given opportunity is a "clone" from the prior year?

UPDATE: Dave provided a great solution to Question 2. Question 1 seems like more of a challenge (identifying which opportunities were generated through "cloning" in the past).
A follow-up on Q1 in case this makes possible a solution: What if the name of the cloned opportunity is the same as it was in the prior year except for the fiscal year. I.e., CompanyABC 2014-15 (original opportunity) -> CompanyABC 2015-16 (cloned opportunity). Based on this naming convention, would there be some way to identify opportunities cloned in the past?

Best Answer

You can do that using triggers. To Answer your second question, see the explanation below

  1. First create a custom text field on Opportunity object, and let's call it RecordId.
  2. Create a workflow rule that on create, populates RecordId with SFDC Id.
  3. In our create trigger, you can check for the RecordId.
  4. If RecordId == '', then the record is new.
  5. If RecordId != ”, then the record is being cloned.

This is because trigger is executed before the workflow rule, and as a result whenever a new record is created this RecordId will not contain any value.

But when a record is being cloned this field RecordId will contain the SFDC record Id of the original object from where it is being cloned. You will be able to identify if this is new record or cloned record and take appropriate action

Actually both of your questions are related and can be answered with above solution.

Please let me know in case of any queries. If this answer helps you resolving your query, mark this as best answer.

Related Topic