Define object relationships

Relationships define the connections between records in different objects, so they create much of the functionality of the objects. For example, you might have an object that lists customers. Another object lists contacts at those companies. You need a connection between the company records and corresponding contact records. When you establish a relationship between the objects, you can indicate which contacts are related to each company.

An object can only access a related object field value one step away. To get a value from an object two steps away, create a related field in an adjacent object and reference the value from there.

Add a relationship

One thing that separates a set of data objects from an application is the interaction or relationships that exist between the objects. For instance, you might have an object for tracking collections activities. This list of interactions by itself does not offer an advantage over a spreadsheet. However, when you create a relationship between the collections activity object and the customer object, you can do more: You can assign customer IDs to collection activities and then view collection activities as part of the customer record.

To add a relationship:

  1. Go to Platform Services > Objects. A list of all objects appears.
  2. Find and select the object for which you want to create a relationship.
    Use the Filter by application dropdown list at the top of the page to filter by custom applications.
  3. On the Object Definition page, select Relationships at the top, then select New relationship.
  4. Choose the Related object to which you want to create a relationship, then select Next.
  5. Enter a Singular name and a Plural name for either side of the relationship.

    Changing names here does not affect either object name. These names only apply to lookup fields and related list sections that refer to the relationship.

  6. In Relationship type, choose how many records can be related on either side of the relationship.
    Do not use allocation splits with one-to-one and one-to-many relationships. Using an allocation split in these cases results in multiple line item entries based on the allocation definition. All transactions supporting allocations are affected.

    Relationship type details
    Relationship typeDetails
    One to oneAny record in either object can have only one corresponding record in the other object. For example, if you create an employee profile object, you could create a one-to-one relationship between that object and the standard Intacct employee object.
    One to manyAny one record in the first object can have many related records in the second object. For instance, an invoice can have many related line items. Those line items, however, only relate back to one invoice.
    Many to oneMany records in the first object can be related to a single object in the second object. This behavior is similar to the one-to-many relationship, but, instead, it is established through the object on the other side of the relationship. For example, in an invoice, a line-item object in an invoice would all relate back to a single invoice object.
    Many to many

    Many records in the first object are related to many records in the second object. Many to many relationships are often difficult to maintain and avoided in database design by creating an intermediate table.

    For instance, you can have many sales orders for many objects. This approach might be seen as a simple many-to-many relationship. However, to make sense and take control of the transaction, we create an intermediate object called a line item. The line item has a many-to-one relationship with the sales order object and a many-to-one relationship with the product object. This also allows us to store information about this sales order, such as pricing, and freeze it in time. Even if Product pricing changes, the pricing for this transaction is stored in the line item for the transaction.

  7. Optionally, select one or both Deleting records control options to prevent accidentally deleting any records in your relationship.
  8. Under Properties of lookup field, enter an Integration name for each object. Integration names can only contain alphanumeric characters, hyphens (-), and underscores (_).
  9. Optionally, use Add related list views to pages to select views to which you want to automatically list related records.
  10. Select Save.

Edit a relationship

  1. Go to Platform Services > Objects. A list of all objects appears.
  2. Find and select the appropriate object.
    Use the Filter by application dropdown list at the top of the page to filter by custom applications.
  3. On the Object Definition page, select Relationships at the top, then select Edit next to the appropriate relationship.
  4. Make changes as needed.
    You can modify the relationship properties or orphan records controls, but not the relationship type. If you need a different relationship type, delete the relationship and recreate it with the correct relationship type.
  5. Select Save.

View a list of relationships for an object

  1. Go to Platform Services > Objects. A list of all objects appears.
  2. Find and select the appropriate object.
    Use the Filter by application dropdown list at the top of the page to filter by custom applications.
  3. On the Object Definition page, select Relationships at the top.

Delete a relationship

Before deleting a relationship, double check the objects that shared that relationship to clean up any references or structures you created around the relationship. For example, you might have created a new tab on a standard object to display a view from a related object. You would want to remove that tab.

To delete a relationship:

  1. Go to Platform Services > Objects. A list of all objects appears.
  2. Find and select the appropriate object.
    Use the Filter by application dropdown list at the top of the page to filter by custom applications.
  3. On the Object Definition page, select Relationships at the top.
  4. Select Del next to the relationship to delete.
  5. On the confirmation dialog box, select Yes, then select Delete.

Use a picklist for related object selection

Let's say you add a field to an object that has a relationship to another object. In the user interface, rather than having users select an option from a lookup field, it might make sense to include a picklist. For example, you might have a relationship defined where Location can have many Departments. When creating or editing a department, it would be easiest for users to select a location from a picklist.

To use a picklist option in the UI instead of a lookup field:

  1. Go to the object page that contains the lookup field.
  2. In this example, from the Application menu, go to Company > Setup > Departments.

  3. At the top of the page, select Add.
  4. We'll first add the picklist option to the Department creation page.

  5. At the top of the page, from More actions, select Edit this page.
  6. On the page editor, select the fields section for Location lookup.
  7. Page editor with Location lookup section highlighted and the Show lookup field as picklist option displayed.

  8. Under Properties, select Show lookup field as picklist.
  9. Save your change.
  10. Now let's make sure the edit page also uses a picklist: Go to the object page that contains the lookup field.
  11. In the list view, select Edit next to one of the records.
  12. Make sure to select Edit and not View. The View page does not include the option to change the lookup field.

  13. Repeat steps 3 - 6.

While you don't need to use a picklist on both the create and edit pages, it probably doesn't make sense to use a picklist on one page and a lookup field on the other.