Learned by Doing: How to create and use a Salesforce custom object with a custom component

Overview

This article shows you how to create a Salesforce custom object, then use Talend components to write and read data to a custom component.

 

Prerequisite

To create a Salesforce custom object, you must have a Salesforce administration account.

 

Create a Salesforce custom object

  1. Log in to Salesforce.
  2. Click Setup in the top right corner.
  3. Scroll down, and on the left-hand side, select BuildCreate > Objects.

    image1.png

     

    The Custom Objects window appears:

    image2.png

     

  4. At the top of the table, click New Custom Object. The New Custom Object dialog appears:

    image3.png

     

  5. Click Save.

 

Create custom fields

  1. Scroll down to the Custom Fields & Relationships section.

    image4.png

     

  2. Click New to create a new field.

  3. Select the data type for the field. For example, select data type text, as highlighted:

    image5.png

     

  4. Click Next.
  5. In this example, you will create a field named acct_firstname. It is not required and isn't unique, so it can contain a null value.

    image6.png

  6. Enter requirement for the field name.
  7. Click Next
  8. On this screen, set the security level for the acct_firstname field. Select Visible for all profiles.

    image7.png

     

  9. Click Next.
  10. In this example click Save & New to create another field, but if you were finished creating fields, you would click Save.

    image8.png

     

  11. Choose the text data type for the second field.

    image9.png

     

  12. Name the field acct_lastname. It is not required and is not unique, so it can contain a null value.

    image10.png

     

  13. Click Next and set the field-level security by selecting Visible for all profiles.

    image11.png

     

  14. Click Next

    image12.png

     

  15. Click Save to create the acct_lastname field.

 

Set permissions for my_account_object 

  1. Expand Administer > Manage Users > Profiles on the left-hand side.

    image13.png

     

  2. Click Edit for the Profile Name for which you want to set the permission. For example, set the permission for the “Customer Support Team” profile:

    image14.png

     

  3. Scroll down to the my_account_objects permission as shown below:

    image15.png

     

  4. Select the boxes to set permissions for the group profile. 

  5. In this example, select all permissions.

    image16.png

     

  6. Click Save

 

Verify the my_account_objects permissions 

    1. Log in to the Salesforce workbench (https://workbench.developerforce.com/query.php) with the user login that belongs to the “Customer Support Team” to verify the my_account_objects permissions.

      image17.png

       

    2. Since you just created my_account_objects and have not inserted any data yet, the query returned “no records returned”.
    3. Note: when creating a Salesforce custom object and custom fields, Salesforce will append __c to custom objects and custom fields.

      Example: my_account_objects__c for custom objects and acct_firstname__c and acct_lastname__c for fields.
    4. Use Talend components to write, then read, data from Salesforce custom object:

      image18.png

       

    5. Verify data insertion in Salesforce my_account_objects__c by using Salesforce workbench:

      image19.png

       

Talend Salesforce components raise exception after running for a while

This due to Salesforce setting a limited time of transaction, as shown in the link below:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm

 

The workaround is to limit the transaction to read/write data to Salesforce.

Version history
Revision #:
14 of 14
Last update:
‎08-22-2017 05:02 PM
Updated by:
 
Labels (2)
Contributors