We are here to help.

Custom Object (Contests) Setup Guide

You must be logged in as a system administrator and should be familiar with creating custom Triggers* as a Trigger development experience is necessary when following these steps.

You will be creating a custom Trigger for the Custom Objects you would like to include as part of the Contest Engine Wizard

Triggers need to be created in your Sandbox first

You will need to run unit tests against this new Trigger in order to promote it into your Production org.

*Trigger is a Salesforce term for code that executes on one of your objects when data is created, changed or deleted in that object.

Step 1:

Go to the Setup section, expand the Create section and click on Objects

Step 2:

Find the object you want to make available within a competition and click on the Object Name. In our example, the Custom Object name is Shiny

Step 3:

Scroll down to the Triggers section and click "New"

Step 4:

Your Trigger will start out looking like the screen below. Replace <name> with the name of your custom Trigger. We recommend using the following naming convention: objectname_scblogic. You will then replace <events> with the following: after insert, after update, after delete

Using our Shiny object as the example, below is what this will look like before moving to the next step:

Step 5:

In the second line, insert the text below. Note the bolded text in red which should be replaced with the name of your custom object

Salesforce will require you to code a unit test for your Trigger when deploying from a Sandbox into Production. Due to the unique business rules that you may have in place around your object, we cannot tell you exactly what needs to be in your unit test

At a minimum, you'll need to provide 75% code coverage of your Trigger

This can be done through a simple unit test/apex class which inserts one of you Objects

Using our Shiny Trigger as an example below is an example unit test. You'll have to write an appropriate one for your environment, the test below is designed to show how we insert a new Shiny Object which requires an Opportunity. Your environment, objects, and business rules will be different. Your Salesforce Administrator will know more about the constraints around creating an Object