Exercise - Create an entity in Microsoft Dataverse

Completed

This exercise is written to use the Cronus sample company from the US version of Business Central. You might need to make adjustments to the steps if you use the sample company from your country or region.

Scenario

CRONUS uses in parallel Dynamics 365 Business Central and a few apps based on Microsoft Dataverse. As users in Dataverse apps already use employee data from Business Central, they require one additional entity synchronized with the Union table in Business Central.

You are a system engineer at CRONUS, and are the only person who administers both systems. You are asked to create a new entity in Dataverse and to synchronize it with the Union table in Business Central every day at 8:00am.

Tasks

  1. Publish the web service in Business Central.

  2. Start with Power Apps.

  3. Create a new Entity.

  4. Add fields to the Entity.

  5. Add Key to the Entity.

  6. Save the Entity.

  7. Connect an Entity with the web service in Business Central.

Steps

  1. Publish the web service in Business Central.

    1. Log in into your Business Central.

    2. Select the Search icon, enter Web Services, and then select the related link.

    3. On the Web Services page, select New.

    4. Fill the following fields:

      1. In the Object Type field, select the Page option.

      2. In the Object ID fields, enter 5213. Move to the next field.

      3. In the field Service Name, enter Unions.

      4. Select the checkmark field in the Published field.

      5. Move to the next line to refresh the record.

      6. Copy the link from OData V4 URL field to your notepad.

    5. Select Back (the left arrow command).

  2. Start with Power Apps.

    1. Open Power Apps in your browser.

    2. Expand Data in the left menu and then select Entities.

  3. Create a new Entity.

    1. Select the +New entity command.

    2. In the New entity panel, in the Display name box enter Employee Unions.

    3. In the Primary field area, change the value in Display name to Code.

    4. Select Create.

  4. Add fields to the Entity.

    1. Select the +Add field command and complete the following steps.

      1. In the Field properties panel, in the Display name field enter Name.

      2. Select Done.

    2. Select the +Add field command and complete the following steps.

      1. In the Field properties panel, in the Display name field enter Phone number.

      2. Expand the Data type field and select the Phone option.

      3. Select Done.

    3. Select the +Add field command and complete the following steps.

      1. In the Field properties panel, in the Display name field enter Number of members.

      2. Expand the Data type field and select Whole number option.

      3. Select Done.

  5. Add a Key to the Entity.

    1. Select the Keys tab.

    2. Select the +Add key command.

    3. In the Key panel, in the Display name field enter Code.

    4. Select the checkmark for the field Code.

    5. Select Done.

  6. Save the Entity.

    1. Select Save entity.
  7. Connect the Entity with the web service in Business Central.

    1. Select the Get data command from the command bar.

    2. Select the OData source.

    3. Paste the web service URL you previously copied to your notepad.

    4. select Organizational account in the Authentication kind field.

    5. Select Sign in and confirm your credentials.

    6. Select Next.

    7. If you have entries in your Union table, you'll see them in the Power Query - Edit queries window. If you don't have entries, you'll see only columns with no entries.

    8. Select Next.

    9. In the Load settings section, select Load to existing entity.

    10. For the Destination entity, find the EmployeeUnions entity (keep in the mind that this entity name will have a specific prefix).

    11. Do the following in the Field mapping section in the Source column:

      1. For the Destination field - Code, enter Code.

      2. For the Destination field - Name, enter Name.

      3. For the Destination field - Numberofmembers, enter the No_of_members_Employed.

      4. For the Destination field - Phonenumber, enter the Phone_No.

    12. Select Next.

    13. In the Power Query - Refresh setting window, select Refresh automatically.

    14. In the Refresh every, enter 1 days.

    15. In the Start at field, enter the current date as a date and enter 8:00AM as the time.

    16. Select Create.

    17. When the system finishes synchronization, select Done.