---
url: "https://www.skedulo.com/release-notes/fix-for-hasmany-field-naming-when-mapping-custom-lookup-fields-for-salesforce-teams"
type: "releaseNote"
title: "Fix for HasMany field naming when mapping custom lookup fields for Salesforce teams"
date: "2024-10-11"
---

# Fix for HasMany field naming when mapping custom lookup fields for Salesforce teams

We have fixed a bug in the web app settings for managing field mappings for Salesforce teams. When mapping a Lookup field, the system created a corresponding HasMany relationship field with a confusing name on the parent object. The system now creates the HasMany field using the name sourced from t…

Prior to this release, when you used the web app to map a lookup field into the data model for a Salesforce team, the UI automatically created a corresponding HasMany field on the related object; however, it used the name of the parent object as the name of the field.

For example, when creating a lookup field from Invoices to Jobs:

- The administrator would create a **Lookup** field to Jobs named “Job” on the Invoices object.
- The system would create a **HasMany** field on the Jobs object with name “Job”.

The name of the HasMany field does not reflect the relationship; since the Job can have many Invoices, rather than many Jobs. Also, this bug meant that if you created a Lookup field to Jobs on another object, the system would attempt to create a second Lookup field called “Job”, resulting in a naming conflict and an error.

**Updated behavior:** With this fix, the HasMany field is named according to the “Child Relationship Name” property defined in Salesforce.

For example, when creating a lookup field from Invoices to Jobs:

- The administrator creates a **Lookup** field named “Job” on the Invoices object.
- The system creates a **HasMany** field on the Jobs object with name “RelatedInvoices” and label “Related Invoices”. These values are sourced from the **Child Relationship Name** property defined on the lookup field in Salesforce (which, in this example, is “RelatedInvoices”).

This ensures that the generated field names are both meaningful and consistent with Salesforce standards.
