# Configuring Object-Level Comments (QMS)

<a href="/en/gr/78610/">QualityOne Vaults</a> allow users to <a href="/en/gr/68376/">communicate and collaborate</a> on object records using _Comment Types_. _Comment Types_ are provisioned from a target QualityOne QMS object and _Comments_ object within the **Comment Setup** page, and include user mention functionality. Comments allow collaboration between the following types of users:

* Internal user to external user
* External user to internal user
* Internal user to internal user

User mentions allow users to tag specific users in a comment to allow those users to collaborate more efficiently. User mentions trigger a notification to the mentioned users in the _Comment_ record. You must configure the appropriate _Read_, _Create_, _Edit_, and _Delete_ permissions for Internal and External users on the target objects required. User mentions in object comments are not included in <a href="/en/gr/2157/">Vault Summary Emails</a>, if configured.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: Contact your Veeva Representative to enable this feature in your Vault.</p>
    </div>
  </div>
</div>



## Defining User Types {#define-user-types}

Comments on objects use two (2) user types: Internal and External. You determine a user's user type by setting the value in the _Organization_ field on the _User_ (`user__sys`) object. Values in the _Organization_ field in the _User_ object differentiate between an internal organization and an external organization. <a href="/en/gr/36122/#user-role-setup--object-class">Matching Sharing Rules</a> apply to the _Organization_ field on the _Comment Type_ object from the _User_ object, determining the user type for the comment records. When a _User_ object record is determined to be either Internal or External, the user is able to interact with the _Comment Type_ object according to their user type permissions.

Comments on object functionality behaves in the following ways for users after you have defined user types:

* Internal users can read all comment records for their organization, provided they have been granted the appropriate permissions.
* External users can only read comment records that have the _Organization_ field from the comment record set to their own organization's name.
* Internal users cannot mention External users from different organizations in one (1) comment. Internal users can only mention External users from the same organization.
* All users can edit and delete comment records that they have created themselves, provided they have been granted the appropriate permissions. Users cannot edit or delete other users' comment records.
* Comments created by an Internal user for Internal users cannot be read by External users.

## Configuring Comment Target Objects {#config-target-objects}

Configuring comments on a target object requires the following:

### Comment Setup Page {#comment-setup-page}

For a QualityOne QMS object to have comment functionalities in each object detail record page, you need to create a _Comment Type_ for the specific object. Use the _Comment Setup_ page to allow comments to be provisioned for the target object. This is called a _Comment Type_.

Comment types generate separate target comment objects (associated to the target object) with the naming convention _[target\_object\_name]\_comment\_\_v_ where [target\_object\_name] refers to the QualityOne QMS object name. For example, provisioning comments on the target _Complaint_ (`complaint__v`) object creates the _Complaint Comment_ (`complaint_comment__v`) object as the _Comment Type_.

Only _System Administrator_ or _Vault Owner_ security profiles can view, create, and delete _Comment Types_ on the _Comment Setup_ page.

<a href="https://platform.veevavault.help/assets/images/CPC-General-CommentSetupPage.png" data-lightbox="CPC-General-CommentSetupPage.png" data-title="" data-alt="Comment Setup Page">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/CPC-General-CommentSetupPage.png" alt="Comment Setup Page" style=""  />
</a>

### Creating Comment Types {#create-comment-types}

To create a comment type:

1. Navigate to **Admin > Configuration > Component Setup > Comment Setup**.
2. Click **Create**.
3. Select a **Target Object**.
4. Click **Continue**.

A message indicates the provisioning is in progress and sends a notification once the comment type is provisioned.

### Deleting Comment Types {#delete-comment-types}

Comment types can only be deleted if there are no existing comment object records for the comment type.

To delete a comment type:

1. Navigate to **Admin > Configuration > Component Setup > Comment Setup**.
2. In the appropriate comment type grid item, click **Delete** from the inline **Actions** menu.
3. Click **Continue**.

### Configuring Object Layouts {#layouts}

The layout for a _Comment Type_ object (for example, _Complaint Comment_ (`complaint_comment__v`) object, a provisioned target object) displays each comment record, whereas the target object displays the _Comment Type_ in the object detail record page as a _Related Object_ section, after configuring. Insert the _Comment_ control section into the _Comment Type_ object layout to allow user mentions in comment records, and to allow hiding and auto-filling of the _Organization_ field for External users.

After [creating a comment type][1], you need to update the following <a href="/en/gr/26387/">object layouts</a>:

* For the _Comment Type_ object layout:
  * **Detail Form Section**: 
    * Include the _Organization_ field.
    * Insert the _Comment_ control section with the slider (<img class="inline" src="https://platform.veevavault.help/assets/images/CPC-Icon-Slider.png" alt="Slider Icon" style="" />) icon. This is critical to allow user mentions in comments. For example, if you provisioned comments on the _Complaint_ (`complaint__v`) object, navigate to the layout for the _Complaint Comments_ (`complaint_comment__v`) object.
    * Remove the default _Comment_ field.

<a href="https://platform.veevavault.help/assets/images/cpc-qms-comment-setup-page.png" data-lightbox="cpc-qms-comment-setup-page.png" data-title="" data-alt="Comment Component Setup Page">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/cpc-qms-comment-setup-page.png" alt="Comment Component Setup Page" style="max-width: 70%;"  />
</a>

* For the target object layout:
  * **Related Object Section**: Insert the _Comment Type_ object. For example, if you require comments on the _Complaint_ (`complaint__v`) object, navigate to the object layout for the _Complaint_ (`complaint__v`) object and insert _Complaint Comments_ (`complaint_comment__v`) as the related object.

## Limitations {#limitations}

The following limitations affect comment and user mention functionality:

* Users must mention at least one (1) other user in a comment record.
* Comments functionality can be provisioned to all QualityOne QMS objects except objects that are inactive, locked, child, or are already comment objects.

## Configuring User Permissions {#user-permissions}
  
You must ensure users have the appropriate read and create <a href="/en/gr/22824/">permissions</a> to access the appropriate objects and object fields in addition to the permissions outlined below:

You must ensure Internal and External users have the appropriate permissions to access the appropriate _Comment Type_ objects, target objects, target object types, and target object fields. The _Organization_ field in the user profile must have an organization value to indicate the user type. To be able to mention a user, the user creating the mention must have _Read_ permissions configured for _Comment Type_ object and the target object required.

## Related Permissions {#permissions}

You can complete all the steps in this article with the standard _System Administrator_ or _Vault Owner_ security profile. If your Vault uses custom security profiles, your profile must grant the following <a href="/en/gr/22824/">permissions</a>:

<table>
  <tr>
    <th><strong>Type</strong></th>
    <th><strong>Permission</strong></th>
    <th><strong>Controls</strong></th>
  </tr>
  <tr>
    <td>Security Profile</td>
    <td>Objects: Organization: Read</td>
    <td>Ability to view <em>Organizations</em>.</td>
  </tr>
  <tr>
    <td>Security Profile</td>
    <td>Objects: [Target Object Comment]: Read, Create, Edit, Delete</td>
    <td>
      <p>Ability to make changes to target object comment objects.</p>
      <p>You must create a comment type before completing this action.</p>
    </td>
  </tr>
  <tr>
    <td>Security Profile</td>
    <td>Objects: [Target Object]: Create, Edit, Read</td>
    <td>Ability to create, modify, and view new Vault target objects.</td>
  </tr>
</table>

[1]: #create-comment-types