Introduction to the Force.com Database FAQ

Contents


This is the FAQ for the webinar Tech Talk: Introduction to the Force.com Database. For more resources, see the Database Services page in the Technical Library.

Why do last 3 characters in ID change when data is pulled using APIs?

This is to provide case insensitivity when replicating data to a traditional on-premise database. Some databases don't support case, or if they do, they may not have been configured that way.

I thought record IDs were 18 characters?

Because there are applications like Access which do not recognize that 50130000000014c is a different ID from 50130000000014C, an 18-digit, case-safe version of the ID is returned by all API calls. The 18 character IDs have been formed by adding a suffix to each ID in the Force.com API. 18-character IDs can be safely compared for uniqueness by case-insensitive applications, and can be used in all API calls when creating, editing, or deleting data. If you need to convert the 18-character ID to a 15-character version, truncate the last three characters. We recommend that you use the 18-character ID.

Will there be more than one level to the master-detail relationships ?

If a custom object has already been set up on the detail side of a master-detail relationship, it cannot also be the master side of a different master-detail relationship.

If I don't use Eclipse, can I still see my organization's metadata in a browser-like tool?

Of course! There are multiple tools on developer.force.com, including Workbench, Apex Explorer, and there's a Mac version: http://www.4s4c.com/osx/soqlx/ . See the Tools page.

During the creation of the object/tab you have the chance to say what profiles can see the TAB but there is no step to say only these profiles can SEE or have CRUD on the object. Did I miss the CRUD step or is it just not there?

Setup | Administration Setup | Manage Users | Profiles to set CRUD on the object for the profile

Is there any processing going on background when we choose this option (Allow Reports)? I don't really understand, what is the use of selecting this option.

To be able to report on the object, you select Allow Reports. This configures the reporting engine to be aware of that object. If you don't select that option, then you will not be able to generate reports on the object.

How do we Internationalize? ex: if i had to internationalize the pickup list

Through the Translation Workbench. Please see the online help for more details on configuring the Translation Workbench.

What tools does does Force.com provide so that if you add a field or a relationship after you've started using the database you can update all of the records appropriately?

The simplest way is to use the Data Loader to extract and update your data.

When is it best to use a Master-Detail vs. a Lookup relationships when creating an object? What are the plus/minus of each?

These 2 online help articles hav some great information on the differences to be considered:

Are there resources available to learn how to use Eclipse and the Force.com IDE?

The IDE comes with an extensive help library integrated into Eclipse. You can access it by menu - Help/Help Contents. Also see the home page for the IDE in the technical library: Force.com IDE

Can you roll back data according to the activity history?

Not using any standard functionality. You would need to extract the data, process it, and then re-update the records with the values you want to restore.

How do we provide multicurrency support in the currency data type? is this sortable (numerically and by currency type?)

Please search the online help for 'multicurrency' to get an overview of the feature and an Implementation Guide.

What is the migration strategy typically from dev to prod environments for large databases with good bit of data already housed?

It depends on the integration tools available. You could use the Data Loader to extract and import the data. Ultimately this is part of the implementation's data migration strategy.

Are there limits to the number of objects?

The number of custom objects available depends on the edition: https://na3.salesforce.com/help/doc/user_ed.jsp?section=help&loc=help&target=limits.htm

Is there documentation on creating the test case for migrating triggers from a development environment to productions?

Here is an article that provides an introduction to Apex Test Methods: An Introduction to Apex Code Test Methods

Can I write insert/select in SOQL?

No, that is handled with create, update and delete methods in the API or in Apex code

In Eclipse, how do I get the plugin which emulates the sforce explorer functionality?

Double-click on the salesforce.schema icon at the bottom of your Force.com project.

Can I export tables and info from a Microsoft Access database into a Force database automatically, preferably by creating a command line?

A partner solution, DBAmp, can help with this type of solution. Or you could extract the data out of Access, then use the Data Loader to import it into your org.

Does the data storage differ, if "Allow Reports" option is enabled for objects?

No. The 'Allow Reports' enables the ability to create and run reports against that object. But no impact to the data storage.

Will it create different databases for each application? Or only one of all my applications?

There is only one logical Force.com Database for your entire Force.com environment. So if you have multiple applications, the underlying applications are part of the same logical database. But you can only grant access to the proper applications including CRUD perms through Profiles. In short, even though its the same database, you have plenty of options to configure and apply the proper security settings.

What about data privacy considerations? Can we get any exports or backups of the databases as needed?

Yes, using the API or Data Loader you can take exports of what you need. There are also some partner solutions, such as Informatica, that automate data replication and backup processes.

What is Eclipse?

Eclipse is an open source/free IDE (integrated development environment): http://www.eclipse.org/

Did you show how to create the app before you started creating the custom object?

New apps can be created by going to Setup > App Setup > Create > Apps in your Developer Edition org.

Is there a way to use Roll up summary with a look up data type instead of master-detail?

No, the Rollup Summary field is enabled when the relationship is Master-Detail only. Not lookups. But you could alternatively implement an Apex trigger to update the roll-up value to the related record.

How do you connect IDE to a sandbox?

Select the sandbox endpoint when setting up the project credentials.

Do we need to consider Indexing needs during the Object creation or by default all the fields in the Objects are searchable? Say for Instance I have Description field(Free Text), Can I query on the field with %Soccer%?

No, the Force.com database will automatically index the proper data types. Please see the online help for an explicit list of searchable fields. Lastly, you can't include a long-area text field in the Where clause of a SOQL query. But if it were a text or text-area , Yes, you can use a where clause condition like %Soccer%

How do you track the history of changes to the expense reports?

There are two parts to this answer. First, in the custom object definition, use the 'Set Field History' button to enable audit tracking for the set of fields you desire. Secondly, add the "Audit History" related list to the Page Layout through the Page Layout editor.

Can I write inner join/outer join in SOQL?

Not explicitly - you need to use SOQL equivalents. More information here.

What does mean SObject in Force.com database?

An SObject is a term to represent an Object in your schema. It's the base object representation of all objects. So an instance of an Account record is an sObject. See An Introduction to the Force.com Database to learn more.

Is there documentation on the SOQL syntax used while querying salesforce objects?

Yes, | here

How do you create a 1 to 1 relation between objects?

I would create either a Master-Detail or Lookup relationship between the two. Then I would deploy an Apex trigger on the child object to verify that no more than 1 record can be related to the parent/associated record.

Can you create metadata outside of Force.com and upload it to create apps outside of Force, including creating database objects, visualization and logic?

Yes, this can be done through the Force.com IDE or by writing your own tools against the Metadata API.

How we can select unique column value?

When creating a custom field, there is an option to define the field as Unique to avoid duplicate values entered into that field across the entire Object.

How is data created in a custom app exposed through the Force.com Web Services API?

Each custom object is automatically exposed through the Web Services API. After the object is created, the WSDLs will contain that new object definition. Therefore, you can use the Force.com Web Service API methods against your new custom object(s) that make up your custom app.

How we can we use custom SOQL to build custom report?

When creating custom reports with the standard functionality, there is no way to embed SOQL queries, but instead the user building the report can use the wizard-like report builder to configure the report filters. Additionally, if you wanted to create a Visualforce page for your custom report, you could write the SOQL in the controller. But be aware of governor limits and how much data you need to query for that custom report.

How can I configure a lookup to retrieve my internal key values rather than the internal id generated by the platform?

Lookup relationships store the platform ID.

In Apex there are some process restriction due to performance and multitenant arch. Are there any restrictions in DB?

I assume you are referring to governor limits. There are limits about how many SOQL queries an Apex transaction, how many records can be retrieved in the queries, how many DML statements can be executed, ect. Full list here