Setting a primary on an object

If you create primary type custom fields in your Network instance, you'll want to ensure that records in your Network instance have a primary defined so you can use the field for your business processes. Users can assign a primary on an object from the profile page and if the configuration allows for Network to calculate the primary, specific Network events or changes to records can trigger the calculation. Primary can also be mapped from Veeva CRM.

Review the sections below to understand some of the ways a primary can be set on objects.

Note: These topics apply to all objects where you have created Network Calculated and Unique Checkbox primary fields.

Set an active and valid primary on existing records

After you create a primary field to support your business processes, ensure that a primary is set on existing records. Unique Checkbox primaries must be explicitly set because they will not move unless Network moves the primary to avoid duplicates. For Network Calculated primary objects, Network will calculate the primary over time as records undergo changes and primary calculation is triggered.

To ensure that all existing records in your Network instance have a primary right now, use a source subscription to set the field. You can identify the records that do not have an active and valid primary using reporting.

Step 1: Run a report to identify the objects in your Network instance

The report finds objects that have the following situations:

  • no primary is available on a record
  • inactive or invalid objects have been set to primary

To create a report to find these objects:

  1. In the Network menu bar, click Reports > SQL Query Editor.
  2. In the text box, type the SQL query below.

    Replace the object references (address) with the applicable object and the primary field name, oncology_primary__c, with the name of your primary custom field. Note that the address_ordinal__v field is only available on the address object. Remove this condition to non-address primary fields.

            oncology_primary__c /*Displaying the Oncology Primary located on the Rank 1 Address*/
            address INNER JOIN (
                            oncology_primary__c IS NULL
                            OR oncology_primary__c <> 'Y'
                        AND entity_vid__v NOT IN (
                                    address_status__v = 'A'
                                    AND record_state__v IN (
                                    AND oncology_primary__c = 'Y'
                    GROUP BY
            ) entity_with_no_primary
                ON address.entity_vid__v = entity_with_no_primary.entity_vid__v
            address_ordinal__v = 1
  3. Click Run.

This query extracts all of the active and valid records. The objects can be set to primary in the subscription file.

Considerations for address report results:

Values in the address_ordinal__v field are maintained by Veeva OpenData for OpenData addresses or by the record owner for non-OpenData addresses.

  • If there are multiple objects on the same entity with address_ordinal__v = 1. Both addresses will be in the report.
  • If none of the addresses on the entity have address_ordinal__v = 1, the entity won't be displayed in the report.

Step 2: Set a primary on active and valid objects

Use a source subscription to set the objects that you want to be primary - this could be the object that has been recently updated or the object that has the highest Network Entity ID (VID). For addresses, typically the rank 1 addresses are set to primary.

  1. Create a .csv file that contains the fields below.
    entity VID (vid__v)object VID (vid_v)primary field name ( oncology_primary__c)
  2. Create a source subscription that includes this .csv file.
  3. Run the source subscription.

After the subscription runs, all the records that you updated using a source subscription in your Network instance will be updated with a primary.

Triggers for primary calculation

Network calculates the primary whenever new objects are added to your Network instance or specific changes are made to an object.

This applies to the following primary configurations:

  • Network Calculated
  • Unique Checkbox configuration on address objects that use any of the Network calculation options

Network calculations are not triggered for Unique Checkbox primary fields for all other objects or for address objects that do not use the Network calculation options.


Network will calculate a primary if the address fields (listed above) are changed during the following events:

  • New address object is added or specific fields (listed above) on an existing address are changed using source subscriptions, data change requests, or the Network API
  • Merging records manually using Find Suspect Match
  • Merging records in bulk through source subscriptions
  • Unmerging records
  • Downloading records from Veeva OpenData (using OpenData subscriptions or the Ad Hoc Download or Download from OpenData buttons on a record).
  • Syncing a record with Veeva OpenData (using the Sync with OpenData button).

Address fields

Network calculates primary when the following address fields change on an existing record:

  • address_status__v - Any change to the address status field value will trigger Network to calculate; for example, an address becomes inactive. Inactive object states include Inactive and any custom status values in your Network instance. (address_status__v= I).
  • record_state__v - Any change to the address record state value will trigger Network to calculate; for example, an address becomes invalid (record_state__v = INVALID). Invalid object states include Deleted, Invalid, and any custom state values in your Network instance.

    Addresses with the following record states are not considered for primary calculation: MERGED_INTO, PARENT_MERGED, MERGE_INACTIVATED, MERGE_ADDED.

  • <primary_address>__c - Any change to the primary address field value will trigger Network to calculate.

    If a user sets an existing primary address to False, it is excluded when Network calculates a new primary address.

Changing any other address fields, such as Address Line 1 or Address Type, will not trigger any of the calculation rules.

Setting a primary in Network

Primary fields (Unique Checkbox and Network Calculated) can be updated by users on the Profile page.

Assigning a primary field to an object

All Network users can use the profile page to assign a primary field value to an object. For example, a Field Services Manager who manages territories and compensation can edit an address to assign a primary field for specific therapeutic areas.

To assign a primary:

  1. Click the object summary card to expand the object details.
  2. Find the primary field name, click the Value field, and choose Yes/True from the list.
  3. Click Apply to save your update and submit a data change request to local data stewards for review.

Note: After the primary value has been set for a field, any update to the primary field value other than Y (Yes/True) or N (No/False) will be disregarded. For example, if the value is changed to U (Unknown), that change is disregarded.

Other ways primary can be set on records

A primary can be set on an object using the following Network features:

  • Change request API
  • Data change requests
  • Merge and unmerge
  • Data Updater
  • Veeva OpenData updates (subscriptions, downloads, sync)

Duplicate primaries in the Network UI

All users can edit Unique Checkbox and Network Calculated primary fields on record profiles. If the primary field is updated, a data change request is created and sent to local data stewards to accept or reject the change.

To ensure that a field is set to primary on only one object, Network changes the primary value if a field is set to Yes/True multiple times on a record.

This is the only situation where Network will move the primary on a Unique Checkbox configuration that doesn't use any of the Network calculation options.


On an HCP record, the Primary Address for Cardiology field is set to Yes/True for 6941 W Archer Ave.

A user edits the record and sets the same primary field to Yes/True for 1180 W Wilson St Ste E.

To ensure that there's only one Primary Address for Cardiology defined on the record, Network automatically toggles the field value to No/False on the 6941 W Archer Ave address.

The same behavior occurs on data change requests.