Submit a ticket

Create a contract from a custom entity

This guide explains how to configure a new entity and create a contract from it. Follow the steps below to configure your custom entity and proceed with creating a contract in it.


Before configuring a new entity, ensure you have completed all the steps described in the Getting started with Dynamics guide. After that, the Opportunity entity will be automatically configured and ready for contract creation. However, if you want to create a contract from any other entity, you must first configure the entity.

Step 1. Configure a custom entity

To be able to create contracts in a custom entity, you need to set it up first.

To set up your customer entity:

  1. Log in to the Dynamics 365 system with administrator or system customizer credentials.


    Make sure you also have the Oneflow Admin role assigned to you to access the Oneflow settingpage.

  2. Go to Settings > Advanced Settings.
  3. On the Advanced settings page, click the Settings dropdown arrow > Oneflow Settings.
  4. In the Oneflow Settings window, click the Setup entities tab, select the entity to configure (in this guide, we use the NewCustomEntity entity as an example, but the process is similar to other customizable entities in your system), and click the Add entity button.


    It is only possible to create contracts from customizable, non-activity entities associated with a contact or account. Therefore, the system will show only these kinds of entities in the list.

  5. The system will add your entity to the Oneflow entity list in the Inactive status.
  6. Add the Oneflow widget to your custom entity form according to the Add the Oneflow widget to a custom form guide.
    Now, if you navigate to any record of your custom entity in the Dynamics 365 Sales Hub, you should see the Oneflow widget with the following message:

    It means that the widget has been successfully added to the custom entity's form, but the entity has not been fully configured yet.
  7. To be able to activate your custom entity, you need to map the Party or the Participants entity.
    Go to the Party/Participants mapping section and select Dynamics fields corresponding to Party and Participants in Oneflow.


    It is enough to map only one of the fields (Party or Participants) so that you can activate the custom entity and create a contract from it. Moreover, for the Account and Contact entities, the Party and Participants mapping is not required. If the mapping of these fields is skipped, the system will take contacts from the Account or Contact entity.

  8. Now that the fields are mapped, you can activate your entity. Click the toggle bar to activate the entity.
    You can also enable product transfer to Oneflow and configure custom data fields according to the How to set up and use custom data fields guide. However, the product transfer to Oneflow is supported only for the Opportunity and Quote entities for now.
  9. Navigate to Dynamics 365 Sales Hub, open any record of your custom entity, and check if the Create contract button is available on the Oneflow widget.

Step 2. Enable Notes and Activities for the custom entity

To be able to send files in a contract and see updates regarding contract participants on the Oneflow widget, make sure that Notes and Activities are enabled for your entity.
To enable Notes and Activities:

  1. Go to Settings > Advanced Settings.
  2. Go to Settings > Customization > Customize the system.
  3. In the window that appears, go to Components > Entities and click your custom entity. Check if the Notes and Activities checkboxes are selected under the Communication & Collaboration section.


    If Notes is disabled, the Files section under the Create contract section will be hidden. If Activities is disabled, the Contacts section will be hidden in the contract card. Also, once enabled, Activities and Contacts cannot be disabled.

Step 3. Create a contract

To create a contract:

  1. Go to the Dynamics 365 Sales Hub, navigate to your custom entity's record where you want to create a contract, and click the Create contract button on the Oneflow widget.
  2. The system might not display your custom entity on the Dashboard. In this case, use the Advanced Find feature.
  3. On the Advanced Find tab, go to the Look for field, select your custom entity, and click Results.

    There you can select a record in which you want to create your contract.

  4. The system will open the Oneflow - Create contract window with the first Workspace and the first corresponding Template automatically selected (you can select other values if needed). Please, specify the Contract name and at least one Contact, then click Create contract.


    It is possible to choose up to 10 contacts for the contract. If all ten are selected, other checkboxes become disabled. Please, refer to the Edit contract participant data chapter of this article for more information.

    The system will automatically open the created contract in Oneflow in a separate browser tab. In the Oneflow widget, you will see created contract information:
    - Contract name
    - Contract status
    - Contacts with their statuses
    - Updated and created dates.

    Click the right or left arrow at the bottom of the widget to navigate between contract cards. To create a new contract, navigate to the last card with Create contract button. It's possible to create up to 10 contracts related to one entity.

Create contracts with products

To be able to create a contract from an Opportunity or a Quote entity with products in Dynamics 365 Sales Hub, the Oneflow contract template must contain precisely one product table. Otherwise, a warning message will appear, and the system won't add items to the contract.

To create a Oneflow contract template with a product table:

  1. Log in to Oneflow with the same email you use for logging in to the Dynamics 365 Sales Hub.
  2. Go to Templates and click Create template.
  3. Name the template and click '+' > Product table to add a product table:
  4. Select the Dynamics CRM Template in the Template group field, and other settings as per your business needs, and click Save template.
  5. Make sure to activate your template on the Templates page.
  6. Now when you create a contract in Dynamics 365 Sales Hub, specify the Workspace that corresponds to Oneflow's one and the contract Template:
    When the contract is created, the products from Dynamics 365 will be automatically transferred to the Oneflow contract product table.

Add attachments and a PDF to the contract

To be able to add attachments and a PDF document to a contract, the Oneflow contract template must contain precisely one PDF and one Attachment section. Otherwise, a warning message will appear, and the system won't add files to the contract.

To upload files:

  1. In the Oneflow - Create contract window, click the Upload link or drop files to the Files section. You can upload several files simultaneously. After files are uploaded, they will appear in the Files section and be automatically selected. Uploaded files are stored in Dynamics 365 in the Timeline of the entity where you create the contract.


    You can add up to 20 files, each of which does not exceed 20 MB, for a total of 50 MB per contract.

    PDF files appear in the Files section like other files and can be downloaded in the same way.
    By default, the Display in PDF sectionAttachments section of the Oneflow contract.
    To add a PDF document to the PDF section in a Oneflow contract:
  2. In the Files section, select the PDF file you want to add to the PDF section and enable the Display in PDF section feature.


    You can enable the Display in PDF section feature only for PDF files. And only one PDF file can be marked to display in the Oneflow contract PDF section.

  3. Select other files you want to add to the Oneflow contract as attachments and proceed with contract creation. After the contract is created, files will appear in the contract's Attachment and PDF sections.

Edit contract participant data

While creating a contract, you can edit participants' data. 

To edit a participant:

  1. In the Oneflow - Create contract window, click the Edit icon next to the corresponding contact.
  2. In the Oneflow - Edit Participant window, you can change the participant's Role, Email, Phone number, and type (Party or Individual). When you're done with editing, click the Save button. To reject changes, click Cancel.

Add multiple emails and phone numbers to participant

You can configure up to three emails and phone numbers for contract participants. The system will add all mapped values to the corresponding dropdown list in the Edit participant window. 


Before adding new email addresses or phone numbers for a participant, ensure that the account they belong to has the appropriate fields.

To configure multiple emails and phone numbers:

  1. Go to the Dynamics 365 Advanced Settings.
  2. Click the Settings dropdown arrow > Oneflow settings.
  3.  On the Get started tab, navigate to the Configure account and contact fields step and click Add another Phone number or Add another Email link.
  4. In the new field, select the Dynamics contact field you want to map to a phone number or email. The system will apply the mapping immediately.
  5. Click the Delete icon  to remove the phone number or email mapping.


    You can remove only additionally added mappings. At least one email and phone number mapping should be present.

  6. Now you can check if the fields are mapped. Go to entity record, click Create contract on the widget, and open the Edit participant window to check that newly mapped fields appeared in Email / Phone number dropdown lists. Now you can select which email and phone number are suitable for a particular participant.


    If the field value is empty in the current participant's contact card, no value will appear as a variant in the dropdown list in the Edit participant window.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.