Start integrating with ONEiO for free!
SIGN UP

How to set up a Salesforce Custom Object in ONEiO

Overview

This article explains how to incorporate a Salesforce custom object into your Salesforce endpoint in ONEiO. Before you begin, ensure you've created a Custom Object in Salesforce. Refer to the Salesforce documentation for a detailed, step-by-step guide on creating a Salesforce custom object.

The default objects - Case, Asset, Contact, Contract, Lead, Opportunity, Order, and Product are already supported by ONEiO.

  1. Set up a trigger in your Salesforce custom object
  2. Create an integration rule in ONEiO's account in Salesforce
  3. Create a custom entity type in your Salesforce endpoint in ONEiO
  4. Test the integration of your custom entity type

 

Set up a trigger in your Salesforce custom object

In Salesforce, navigate to your custom object:

Setup   Object Manager   Object Name   Triggers

Here's the code snipped you need to add in Triggers. 

trigger ONEiO_[object_name]Trigger on [API_name] (after insert, after update) {
ONEiO_TriggerHelper.onAfterInsertProcessRecords((List<SObject>)Trigger.new);
}

Replace [object_name] and [API_name] placeholders with the corresponding information.

Placeholder  
[object_name] Fill the field with a name of your choice but we recommend to use the Custom object name (i.e. Country) for consistency
[API Name] Fill the field with the API name (you find it in the custom object's Details tab)

 

Create an integration rule in ONEiO's account in Salesforce

Log in to Salesforce using your integration user account. Once logged in, follow these steps to navigate to ONEiO's integration rules:

1. Go to the App Launcher menu.
2. Look for ONEiO's integration rules.
3. Click on it to access the integration rules interface.
4. From there, select the option to create a new rule.

Note

This rule serves as a placeholder and is essential for ensuring the functionality of the integration. Even though it is a dummy rule, it is necessary to have at least one rule configured to set up the integration process.

 

Create a custom entity type in your Salesforce endpoint in ONEiO

Head over to your Salesforce endpoint and click on the Entity types tab. If you haven't set up your Salesforce endpoint type yet, check out the article How to configure Salesforce and ONEiO for successful integration for step-by-step guidance.

Click on "+ Add new entity type"

Note: The "Object" field must have the correct API Name value during entity type creation and cannot be edited afterward from the UI. Contact our support team for assistance with any necessary changes.

Field name Value
Object Fill the field with a name of your choice but we recommend to use the Custom object name (i.e. Country) for consistency
Display name Fill the field with the API name (you find it in the custom object's Details tab)
Id element in sync response Add "Id" (this is capital-sensitive)
ID Attribute Add "Id" (this is capital-sensitive)

Great! With the new entity type set up, the next step is to ensure the integration functions properly by performing testing.

 

Test the integration of your custom entity type

Go to Routing Rules and choose "+ Create new rule"

Select the Salesforce endpoint and your custom entity type (e.g., Country). For the action, choose "Drop the message." The goal here is to verify that we receive a message containing the information of the newly added country. The rule will look like this:

Lastly, proceed to Salesforce and create a new country record.

Monosnap Italy | Country | Salesforce 2024-03-12 12-38-40.png

Now, return to ONEiO and navigate to the message tab. In the list of messages, you should find one containing all the information about the newly added country.

This completes the setup process for integrating a Salesforce custom object.

 

Happy Integrating!

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.