Creating Synonyms

How to:

Synonyms define unique names (or aliases) for each object that is accessible from the server. Synonyms are useful because they hide the underlying data source location and identity from client applications. They also provide support for extended metadata features of the server, such as virtual fields and additional security mechanisms.

Using synonyms allows an object to be moved or renamed while allowing client applications to continue functioning without modification. The only modification required is a redefinition of the synonym on the server. The result of creating a synonym is a Master File and an Access File, which represents the server metadata.


Top of page

x
Procedure: How to Create a Synonym for a Salesforce.com Object
  1. From the Data Management Console, right-click Application Directories, select New and then Synonym.

    The Select adapter to configure or Select connection to create synonym dialog box opens.

  2. Select a connection for the configured adapter and click OK.

    The first of a series of synonym creation panes opens, showing a list of all of the available salesforce.com objects, as shown in the following image.

    synonyms

  3. Select the check box for the objects that you want to create synonyms for.

    If you want to change the name of the synonym from the default name, click the name and edit as needed.

  4. Click Create Synonym.

    The Status pane indicates that the synonym was created successfully.

The synonym is created and added under the specified application directory.

Note: You can also create a synonym from the Adapters page by right-clicking a configured adapter connection and selecting Create Synonym.


Top of page

x
Procedure: How to Create a Cluster Join for Salesforce.com Objects

A synonym with a cluster join facilitates reporting against multiple salesforce.com objects.

Salesforce.com relationships between objects are described in the data models on the web site. Search by data model for a list of the entity relationship diagrams (ERDs) available. For example, the Sales Objects model includes accounts, contacts, opportunities and other related objects. For an example of the Sales Objects model, go to the following Web site:

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_erd_majors.htm

When you create a cluster join for salesforce.com objects, you must make it a subset of the data model. This allows the join between the objects to be performed by salesforce.com, minimizing the number of queries sent to their servers.

For example, say you wanted to create a synonym that would allow you to report from the contact object to get the first and last name of a contact, and the account object to get the company name. From the model shown in the following image, we can see that there is a relationship from Account to Contact.

Here are the steps to create a synonym with a cluster join with that relationship.

  1. Right-click an application directory and select New, Synonym.

    The Select … connection to create synonym dialog box opens.

  2. Select your connection to salesforce.com and click OK.

    The Select Synonym candidates… dialog box opens, as shown in the following image.

  3. Select the check box in front of Account, Contact, and any other objects you want.
  4. Click Create Synonym.

    The Status dialog box opens.

  5. Ensure that for each synonym you selected, the message Created Successfully appears.

    Click Close.

  6. Right-click an application directory and select New, Synonym via synonym editor.

    A blank synonym opens.

  7. Click the Modeling View tab. Right-click the workspace and select Insert, Reference to existing synonym.
  8. Select Account and click Select. The Account object is added to the workflow.
  9. Right-click Account and select Insert, Reference to existing synonym.

    The Insert Reference to Existing Synonym as Child of ACCOUNT dialog box opens, as shown in the following image.

  10. Select contact and click Select.

    Note: Under Join Type some of the synonyms have a value Matching primary keys. To create a synonym with a cluster join for salesforce.com objects, you must select one of those synonyms. The Join Condition shown will be used to join to the two objects.

    The two objects can now be seen in the modeling view.

  11. Click the Save button on the toolbar.

    The Save Synonym As dialog box opens.

    Enter account_contact for the name of the synonym and click Save.

  12. Click the tab at the bottom of the screen to switch to Field View
  13. Ctrl+click on NAME and then scroll down to the CONTACT segment and Ctrl+click on LASTNAME and FIRSTNAME.

  14. Right-click and select Sample Data.

    The report appears showing the Account Name and the contact Last Name and First Name.


Top of page

x
Syntax: How to Control the Retrieval of Deleted Records

You can control whether or not deleted and archived records are retrieved from salesforce.com.

ENGINE SFDC SET SHOWDELETED {YES|NO}

where:

SFDC

Indicates the adapter. You can omit this value if you previously issued the SET SQLENGINE command.

YES

Deleted and archived records are included in the records displayed.

NO

Deleted and archived records are not retrieved. This is the default.


Top of page

x
Syntax: How to Control the Block Size

You can control the number of records retrieved from salesforce.com in one block.

ENGINE SFDC SET BATCHSIZE nnnn

where:

SFDC

Indicates the adapter. You can omit this value if you previously issued the SET SQLENGINE command.

nnnn

The number of records to retrieve in a block. The default is 200. The maximum is 9999.


Top of page

x
Syntax: How to Use Salesforce.com Date Literals and Constants

Salesforce Object Query Language (SOQL) provides useful date constructs, for which there are no SQL equivalents. They can be used in a filter in a SELECT statement, or a TABLE request using the DB_EXPR function.

The following is an example of date constructs being used in a TABLE request using the function DB_EXPR:

WHERE datefield GT DB_EXPR(LAST_YEAR)
WHERE datefield GT DB_EXPR(LAST_N_YEARS:3)
WHERE (DB_EXPR(CALENDAR_MONTH("datefield")) EQ 1)

For more information on these date constructs, see Date Formats and Date Literals in the Salesforce.com documentation.


WebFOCUS