{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":6916,"path":"customer-service-management/migration-of-account-manager-responsibility-access.md","title":"Populate the Type field in relationship tables using the fix script","bundle":null,"doc_type":null,"release":"australia","body":"\n# Populate the Type field in relationship tables using the fix script\n\nLeverage the fix script to add and manage the **Type** field in relationship tables. This script simplifies data mapping and enhances record consistency across the base system.\n\n## Before you begin\n\nRole required: admin\n\n## About this task\n\nStarting with the Yokohama release, a new optional **Type** field is added to the account team member \\[sn\\_customerservice\\_team\\_member\\] table, which previously included the fields **Account**, **User**, and **Responsibility**. This fix script applies to all relationship tables in the base system.\n\nThe **Type** field references the related party configuration \\[sn\\_customerservice\\_related\\_party\\_configuration\\]​ table, a metadata table that enables administrators to define a **Type Configuration** for each responsibility. This field enables administrators to assign meaningful business names to responsibilities, reducing duplication. By internally referencing the same responsibility, the **Type** field simplifies data management and improves record consistency.\n\nYou can use the following procedure to populate the **Type** field using the fix script.\n\n## Procedure\n\n1.  Identify distinct Responsibility values in the relationship table that you want to update.\n\n2.  Create corresponding Type Configuration records in the related party configuration \\[sn\\_customerservice\\_related\\_party\\_configuration\\]​ table.\n\n3.  Run the following fix script to populate the **Type** field.\n\n    ```\n    fixRelatedPartyTypeField(String tableName, String appliesTo, String entityType, String typeField, String responsibilityField)\n    /**\n    \t * Fixes the related party type field in the specified table.\n    \t *\n    \t * @param tableName  The name of the table to update.\n    \t * @param appliesTo  The value for the applies_to field.\n    \t * @param entityType The value for the entity_type field.\n    \t * @param typeField  The name of the type field to update. If null, defaults to FIELD_TYPE.\n    \t * @param responsibilityField The name of the responsibility field to update. If null, defaults to FIELD_RESPONSIBILITY.\n    \t */\n    ```\n\n\n## Result\n\nThe fix script:\n\n-   Automatically populates the **Type** field for matching records in the selected relationship table.\n-   Maps existing responsibilities to their corresponding Type Configuration records.\n-   Processes updates in batches for optimized performance.\n-   Logs updates for reference.\n\n**Note:** For large record volumes, run the fix script during system downtime to avoid performance impacts.\n\nYou can manually populate the **Type** field by navigating to the related party configuration \\[sn\\_customerservice\\_related\\_party\\_configuration\\]​ table and creating Type Configuration records for each distinct responsibility.\n\n## Example\n\nSuppose that you want that to populate the **Type** field in the account team member \\[sn\\_customerservice\\_team\\_member\\] table, where the table uses the following responsibilities:\n\n-   Account Manager 1\n-   Account Manager 2\n-   Account Manager 3\n\n1.  Navigate to the related party configuration \\[sn\\_customerservice\\_related\\_party\\_configuration\\]​ table.\n2.  Create three Type Configuration records, one for each responsibility.\n3.  Run the fix script that automatically:\n    -   Maps each responsibility to its corresponding **Type**.\n    -   Populates the **Type** field for all records in the account team member \\[sn\\_customerservice\\_team\\_member\\] table.\n\n"}}