Setting an object to primary

AD
DM
DS

Use primary custom fields to designate a "best" object to support your business practices.

If you create primary type custom fields, 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 fields - Primaries must be explicitly set because they will not move unless Network moves the primary to avoid duplicates.

    If you have chosen any of the Unique Checkbox options to allow Network to recalculate a primary, those changes will occur over time as records undergo changes and primary calculation is triggered.

  • Network Calculated fields - 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: The address_ordinal__v field is only available on the address object. Remove this condition to non-address primary fields.

    SELECT
            address.entity_vid__v,
            vid__v,
            address_ordinal__v,
            oncology_primary__c /*Displaying the Oncology Primary located on the Rank 1 Address*/
        FROM
            address INNER JOIN (
                SELECT
                        entity_vid__v
                    FROM
                        address
                    WHERE
                        (
                            oncology_primary__c IS NULL
                            OR oncology_primary__c <> 'Y'
                        )
                        AND entity_vid__v NOT IN (
                            SELECT
                                    entity_vid__v
                                FROM
                                    address
                                WHERE
                                    address_status__v = 'A'
                                    AND record_state__v IN (
                                        'VALID',
                                        'UNDER_REVIEW'
                                    )
                                    AND oncology_primary__c = 'Y'
                        )
                    GROUP BY
                        entity_vid__v
            ) entity_with_no_primary
                ON address.entity_vid__v = entity_with_no_primary.entity_vid__v
        WHERE
            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 Veeva 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)
    22334455669988776655Y
  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.

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.