Jump to content

Business Central: Difference between revisions

From Resco's Wiki
Marek Rodak (talk | contribs)
No edit summary
 
(27 intermediate revisions by 2 users not shown)
Line 2: Line 2:
'''Microsoft Dynamics 365 Business Central''' is an enterprise resource planning system from Microsoft. The product is part of the Microsoft Dynamics family.
'''Microsoft Dynamics 365 Business Central''' is an enterprise resource planning system from Microsoft. The product is part of the Microsoft Dynamics family.


[[Resco Cloud]] can connect to Business Central using one of the following methods:
Different ways exist for Resco technology to interact with your Business Central data.
* Via [[Power Automate]] + [[Resco Cloud connector]]: full-featured integration using a '''third-party''' Microsoft service
* Using [[Integrations]] (Preview): connect your Resco Cloud organization to Business Central '''directly''' from Woodford.


This article explains the second method in more detail.
== Resco mobility via Power Platform ==


[[File:Connect to business central directly from resco cloud.png|alt=Microsoft Dynamics 365 Business Central - Resco Scheme|600px]]
Business Central can integrate natively with '''Dataverse/Power Platform''' ([https://learn.microsoft.com/en-us/dynamics365/business-central/admin-common-data-service Microsoft documentation]). By installing [[Resco Suite]] to your Dataverse/Power Platform environment you can benefit from native integration between Resco and Power Platform and use [[Resco Mobile CRM]] as your mobile frontend. Resco fully supports Dataverse's [[virtual table]]s, allowing you to access Business Central via Resco mobile apps.


== Register Resco application in Business Central ==
[[File:Businesscentral-dataverse-rescomobilecrm.png|600px]]


Before you can start migrating data between Resco Cloud and Business Central, you must register the Resco application (clientId) in Business Central and grant Resco consent with accessing Business Central data.
== Resco mobility via Microsoft Dynamics ==


# Log in to your Business Central organization and go to the Azure Active Directory Applications.<br>[[File:Bc1.png|alt=Register Resco application in Business Central step 1|600px]]
Business Central can integrate natively with '''Microsoft Dynamics 365 Field Service''' ([https://learn.microsoft.com/en-us/dynamics365/business-central/admin-integrate-field-service Microsoft documentation]). By installing [[Resco Suite]] to your Dynamics environment you can benefit from native integration between Resco and Dynamics and use [[Resco Mobile CRM]] as your mobile frontend. Resco fully supports Dataverse's [[virtual table]]s, allowing you to access Business Central via Resco mobile apps.
# Click '''New''' and fill out the registration form.<!-- <br>[[File:Bc2.png|alt=Register Resco application in Business Central step 2|600px]] -->
# As '''Client ID''', use <code>4abedb2f-19bc-402f-b0b5-b8d17e85aa04</code>. <!-- # Add '''User Permission Sets''' (<code>SUPER</code>). -->
# Grant the necessary consent.<br>[[File:Bc3.png|alt=Register Resco application in Business Central step 4|600px]]


== Install Resco extension on Business Central ==
[[File:Businesscentral-dynamics.png|600px]]
<!--
== Resco mobility via Resco Cloud ==


The extension is required (but see below) for synchronizing between Resco Cloud and Business Central.
If you want mobility for your Business Central without Dataverse/Power Platform/Dynamics, you can use [[Resco Cloud]] instead. It is a CRM server by Resco. It can connect to Business Central using one of the following methods:
# Download [https://github.com/Resconet/RescoIntegrations/releases/download/1.0.1/Resco_RescoIntegrations_1.0.1.11.zip the extension].<br>Optionally, find the latest version of the extension on [https://github.com/Resconet/RescoIntegrations GitHub]. You can also report issues and review recent commits.
# Log in to Business Central and search for "extensions".<br>[[File:Install extension 1.png|alt=Install Resco extension on Business Central step 2|600px]]
# On the '''Manage''' tab, click '''Upload Extension''' and upload the zip file.<br>[[File:Install extension 2.png|alt=Install Resco extension on Business Central step 3|600px]]
# Open Web Services, click New, select Page, select RescoCustomer and write RescoCustomer as Service Name.
# Repeat it for every custom page from the Resco extension. (RescoCustomer, RescoContact, RescoServiceOrder).


=== Can I integrate without extension? ===
;Via [[Power Automate]] + [[Resco Cloud connector]]
: Full-featured integration using a '''third-party''' Microsoft service
: [[File:Businesscentral-powerautomate-rescocloud.png|600px]]


Yes, but... it depends on your customization of Business Central.


The integration offers two modes of synchronization:
;Using the [[Integrations]] feature of Woodford
* Full sync: download all records of an entity.
: Connect your Resco Cloud organization to Business Central '''directly''' from Woodford.
* Incremental sync: download only changed records.
: [[File:Connect to business central directly from resco cloud.png|alt=Microsoft Dynamics 365 Business Central - Resco Scheme|600px]]
: To read about the last option in detail, see [[Connect Resco Cloud to Business Central]].
-->
== Integration of Business Central and Dataverse ==


To take advantage of the faster, incremental sync, Business Central must have a Version Number field on the entity; and this field must be defined in the mapping in Woodford.
There are several ways in which Dataverse and Business Central can be integrated. Some of the interaction strategies are discussed in a video by the Microsoft's Business Central team:


[[File:Version number.png|alt=To take advantage of the faster, incremental sync, Business Central must have a Version Number field on the entity; and this field must be defined in the mapping in Woodford|600px]]
{{#ev:youtube|https://www.youtube.com/watch?v=-q8Gm7u7R2A|||||start=57}}


You can define the version number using the extension. We recommend using row version number (Big Integer) as the Version number field. You can use Date/DateTime fields as well, but it won't be 100% incremental sync.
To summarize, the available integration options include:
* '''Data Sync''' that replicates data changes between overlapping tables in Business Central and Dataverse
* '''[[Virtual table]]s''' that enable interaction without data duplication
* '''Data and business events''' that trigger [[Power Automate]] flows


== Create integration ==
It is important to realize that these different strategies can be combined. Some tables can be duplicated via data sync, other can stay virtual, etc. In addition to the methods listed by the Business Central team, various third-party solutions simplify integration between the two platforms. Ultimately, each project is unique and requires thought and expertise to succeed.


# Start Woodford and select '''[[Integrations]]''' from the '''Administrator''' menu.
Additional reading:
# Click '''New''' and enter the following details:<br>[[File:Bc4.png|600px]]
* [https://learn.microsoft.com/en-us/dynamics365/business-central/admin-integrate-field-service Integrate with Microsoft Dynamics 365 Field Service]
#* Name - enter a name of your integration
* [https://learn.microsoft.com/en-us/dynamics365/business-central/admin-common-data-service Integrate with Microsoft Dataverse via data sync]
#* Connector - select OData
* [https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/powerplatform/powerplat-overview Microsoft Power Platform integration with Business Central via virtual tables]
#* URL - enter the URL of Business Central OData endpoint (e.g., <code><nowiki>https://api.businesscentral.dynamics.com/v2.0/b8cc0002-2542-46ed-8584-d4868701fbc4/Production/ODataV4/</nowiki></code>)
#* Username - BC account's email address
#* Password - BC account's password
#* CustomQueryParamaters - custom query, which should be added to the every request (e.g., <code>&company=CRONUS%20USA%2C%20Inc.</code>). It is important to include the correct <code>&company</code> parameter.
# Click '''Save'''.


You have created the integration; you can now set it up.
== Integration of Dataverse and Resco ==


== Customize integration ==
'''[[Resco Suite]]''' is a solution that you add to your Dataverse. It allows you to set up your mobile experience for Dataverse:
* Select which tables, fields, and rows should be available in the Resco Mobile CRM app.
* Design the home screen, views, forms, and more.
* Add business logic to bind it all together.


=== How to change default mapping? ===
'''[[Resco Mobile CRM]]''' is the mobile app that grants you access to Dataverse data. This includes
* Standard Dataverse tables
* Dynamics 365 Field Service or Sales tables
* Virtual tables of third-party systems such as Business Central or Finance & Operations
* Custom tables designed by customer/partner
* Custom tables by Resco (needed for extra Resco features such as [[inspections]] or [[Deep dive: Timesheets|timesheets]])


Mapping allows you to match entities and fields on Business Central with entities and fields on Resco. Out of the box, three entities are mapped and ready for synchronization: account, contact, and work order.
== Bringing it all together ==


# Double-click the integration.
The out-of-the-box integration between Business Central and Dataverse is gradually improving. Still, many customers prefer to supplement or replace it with a custom solution. What are some things to keep in mind?
# Select an entity on the External Entities pane (left).
# Select the matching local entity, its primary key, and version number.
# Create a composite lookup if the relation between 2 external entities is defined by more than 1 field.
# In the table below, define the mapping for fields that you want to integrate: select the checkbox and choose a matching '''Local Field'''.
# For all fields with the local type Lookup, click '''Manage Lookup Mapping'''.
# Save all changes.


=== How to enable/disable entity for synchronization? What if I only want to upload or download? ===
* Licensing - Make sure that you have all the necessary Microsoft licenses. Many integration scenarios require premium licenses.
* Prepare for sync issues - Sooner or later, data will get out of sync. Plan ahead and prepare user-friendly and reliable tools and processes that business users can use even without technical knowledge. On Resco's side, we've got you covered with robust and highly configurable [[synchronization]]; [[sync log|detailed logs]], [[Sync Dashboard]], etc.
* Standard or small - Standard scenarios involving field service or field sales generally work satisfactorily out-of-the-box. If you are working on a custom scenario, consider starting small so that the complexity doesn't overwhelm you.
* Competent partner - ERPs are complex systems. Bring in a partner with integration expertise.
* Ultimately, each project is different. Select the appropriate integration strategy. Duplicating the data might require re-implementing complex business logic in Dataverse (and possibly Resco Mobile CRM). Virtual tables bring their [https://learn.microsoft.com/en-us/power-apps/maker/data-platform/limits-tshoot-virtual-tables?tabs=sql own set of limitations].


# Double-click the integration.
== Common scenarios ==
# Select an entity from the '''External Entities''' pane.
# Click '''Enable''' or '''Disable'''.
# Use '''Sync Direction''' to control if you want to exchange data in both direction, upload only, or download only.
# Save all changes.


=== How to change Sync Filter? ===
What are some of the common scenarios involving Resco?
 
* Use Resco's flexible platform to design a custom feature. For example, travel expenses management, with Resco as the mobile client for tracking expenses, scanning receipts, and uploading them to the back office for further processing.
If you want to restrict what data to sync, consider setting up a [[Sync Filter]].
* Use some of Resco's popular features, such as digital forms (Resco Inspections) or timesheet management.
 
* Use Resco as the mobile client for Dynamics Sales or Field Service.
# Double-click the integration.
# Select an entity from the '''External Entities''' pane.
# Click '''Download Filter''' or '''Upload Filter'''.
# Enter custom conditions that serve as a filter for records.
# Save all changes.
 
=== How to reuse mapping in different Resco Cloud organization? ===
 
# On the Resco Cloud organization from which you want to export mapping, double-click the existing integration.
# Do one of the following:
#* Click '''Export''' if you want to export the entire mapping (all entities).
#* Click '''Export Entity''' if you only want to export the selected entity.
 
# On the Resco Cloud organization to which you want to import mapping, create a new integration.
# Double-click it and import the mapping.
# Save all changes.
 
=== Can I sync two external entities with one entity on Resco Cloud? ===
 
The schema of the external system can be vastly different from your Resco Cloud organization. Fortunately, you can map two (or more) external entities to a single Resco Cloud entity. Use upload sync filter to ensure that the correct records from Resco Cloud end up in the right entity on the external system.
 
[[File:Multiple entities.png|600px]]
 
=== Is it possible to setup direction of sync for selected entity? ===
 
Yes, you can setup '''Sync Direction''' on entity level:
* Bidirectional (default)
* Download Only
* Upload Only
 
=== How to define relations between entities? ===
 
You can configure lookups using the '''Manage Lookup Mappings''' button (available for all fields with Local Type = Lookup).
 
Basically, we can divide relations to two groups:
 
==== Lookups defined by one field ====
 
In this scenario you need to select '''Target External Entity''' and '''Target External Field''' as well.
 
For example, to define the Service Order > Customer relation:
# Select customerid as Local Field (Lookup).
# Click '''Manage Lookup Mappings'''.
# In the Manage Lookup Mapping window, select '''Target External Entity''' and '''Target External Field'''.
 
[[File:Integration - lookup defined by one field.png|600px]]
 
==== Lookups defined by more than one field ====
 
For example, to define the Service Item Line > Service Order relation:
# Create a composite lookup, such as "service order".
# Select the same local field (with Local Type = Lookup) for documentNo and documentType external fields.
# Set up the lookup mappings for both fields. In both cases, select the composite lookup "service order" that you created in the first step.
 
[[File:Integration - lookup defined by two fields.png|600px]]
 
=== How to map state/status/picklist values? ===
 
If you map an external field to a local field of the type state, status, or picklist (Status, Status Reason, Option Set) the '''Value Mapping''' button is displayed in that row. It allows you to map external statuses/options to local ones.
 
[[File:Value mapping.png|600px]]
 
=== How to map time/date fields ===
 
Resco Cloud has a single field type for time and date values. If the external system has two fields (one for time, one for date), in Resco Cloud these can be stored in a single field.
 
[[File:Date and time mapping.png|600px]]
 
The '''DateTime Mapping''' button allows you to set up how the external value should be saved:
 
[[File:Date and time mapping 2.png|300px]]
 
=== How to add a new entity to integration? ===
 
Synchronization is effective if the versionnumber of entity (table in Business Central) is compared from the last sync. Therefore we recommend creating a table extension to access field(0) - versionnumber in Business Central.
 
This is an example of an extension for the Customer table. Apply the same principles to other tables.
 
<syntaxhighlight lang="pascal">
tableextension 50101 "Resco Customer" extends Customer
{
    fields
    {
        field(50000; RowVersionNumber; BigInteger)
        {
            Caption = 'RoW Version Number';
            DataClassification = CustomerContent;
        }
    }
    trigger OnAfterInsert()
    begin
        Rec.RowVersionNumber := GetRowVersionNumber(Rec);
        Rec.Modify(false);
    end;
 
    trigger OnAfterModify()
    begin
        Rec.RowVersionNumber := GetRowVersionNumber(Rec);
        Rec.Modify(false);
    end;
 
    procedure GetRowVersionNumber(var recordCustomer: Record Customer) RowVersion: BigInteger
    var
        RecRef: RecordRef;
    begin
        RecRef.GetTable(recordCustomer);
        RecRef.GetBySystemId(recordCustomer.SystemId);
        RowVersion := RecRef.Field(0).Value();
    end;
}</syntaxhighlight>
 
Second step is to add this custom field to your Page/new Page:
 
Some fields will need some special handling, use triggers: OnModifyRecord(), OnAfterGetCurrRecord(), OnInsertRecord() to create your custom logic (e.g., mapping of status).
 
<syntaxhighlight lang="pascal">
page 50110 "Resco Customer"
{
    //....
    //your page definition
    //....
    layout
    {
        area(Content)
        {
            repeater(Group)
            {
                //......
                //your fields
                //......
 
                field(RowVersionNumber; Rec.RowVersionNumber)
                {
                    ApplicationArea = All;
                    Caption = 'VersionNumber', Locked = true;
                }
            }
        }
    }
}
</syntaxhighlight>
 
Upload the created table and page extensions to your Business Central organization.
# Open Web Services in your Business Central.<br>[[File:Open web services in business central.png|600px]]
# Click '''New'''.<br>[[File:Create a new web service.png|600px]]
# Select Page, Object ID of created Page and define Service Name (it will be displayed in Integration Editor in Woodford) and Save.
 
Return to Resco Cloud.
# Open your integration, enable external entity for integration, and do the mapping.
# Select Local entity, Primary Key, Version Number - RowVersionNumber and proceed with field mapping.
 
== Synchronization ==
 
The first sync is [[full sync]]: all records of enabled local entities are cleaned up on Resco Cloud and all records of external entities are downloaded from Business Central. Every next sync is incremental - only changes are transferred.
 
=== On Demand ===
 
# Double-click the integration in Woodford.
# Click '''Sync''' to start synchronization manually.
 
=== Scheduled ===
 
You can set up a [[Server_processes|server process]] to schedule the sync (for example, every day at midnight) or set up a trigger (for example, when an account record is created in Resco Cloud).
 
# Start the [[Admin Console]].
# Select '''Processes Center > Processes'''.
# Click '''New''' to create a new process.
# As '''Category''', select "Workflow" or "Job".
# Schedule or define condition when sync should be executed.
# Write down the procedure that performs the sync:
#* Click '''Step > Function'''.
#* Enter the function: Select '''Server''', then '''IntegrationSync''', then enter the name of your integration defined in Woodford.<br>[[File:Sample sync job.png]]
# Save, publish, and activate the process.
 
=== Web Service ===
 
You can use the [[Resco_CRM_Connector#Available_APIs|REST API]] to trigger sync with a web service.
 
Basic authorization
 
<syntaxhighlight lang="http">
https://rescocrm.com/rest/v1/integration/{name of your integration}/$sync
</syntaxhighlight>
 
<syntaxhighlight lang="xml">
<IntegrationRequest IsSynchronous="false" KeepStatusLog="true">             
    <Ticket></Ticket>
</IntegrationRequest>
</syntaxhighlight>
 
== See also ==
 
* [https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/webapi/discover-url-organization-web-api?view=op-9-1 Discover the URL for your Dynamics organization using the Web API]
 
 
 
 
[[Category:Resco Cloud]]

Latest revision as of 13:32, 24 October 2024

Wikipedia logo
Wikipedia has an article on a similar subject:

Microsoft Dynamics 365 Business Central is an enterprise resource planning system from Microsoft. The product is part of the Microsoft Dynamics family.

Different ways exist for Resco technology to interact with your Business Central data.

Resco mobility via Power Platform

Business Central can integrate natively with Dataverse/Power Platform (Microsoft documentation). By installing Resco Suite to your Dataverse/Power Platform environment you can benefit from native integration between Resco and Power Platform and use Resco Mobile CRM as your mobile frontend. Resco fully supports Dataverse's virtual tables, allowing you to access Business Central via Resco mobile apps.

Resco mobility via Microsoft Dynamics

Business Central can integrate natively with Microsoft Dynamics 365 Field Service (Microsoft documentation). By installing Resco Suite to your Dynamics environment you can benefit from native integration between Resco and Dynamics and use Resco Mobile CRM as your mobile frontend. Resco fully supports Dataverse's virtual tables, allowing you to access Business Central via Resco mobile apps.

Integration of Business Central and Dataverse

There are several ways in which Dataverse and Business Central can be integrated. Some of the interaction strategies are discussed in a video by the Microsoft's Business Central team:

To summarize, the available integration options include:

  • Data Sync that replicates data changes between overlapping tables in Business Central and Dataverse
  • Virtual tables that enable interaction without data duplication
  • Data and business events that trigger Power Automate flows

It is important to realize that these different strategies can be combined. Some tables can be duplicated via data sync, other can stay virtual, etc. In addition to the methods listed by the Business Central team, various third-party solutions simplify integration between the two platforms. Ultimately, each project is unique and requires thought and expertise to succeed.

Additional reading:

Integration of Dataverse and Resco

Resco Suite is a solution that you add to your Dataverse. It allows you to set up your mobile experience for Dataverse:

  • Select which tables, fields, and rows should be available in the Resco Mobile CRM app.
  • Design the home screen, views, forms, and more.
  • Add business logic to bind it all together.

Resco Mobile CRM is the mobile app that grants you access to Dataverse data. This includes

  • Standard Dataverse tables
  • Dynamics 365 Field Service or Sales tables
  • Virtual tables of third-party systems such as Business Central or Finance & Operations
  • Custom tables designed by customer/partner
  • Custom tables by Resco (needed for extra Resco features such as inspections or timesheets)

Bringing it all together

The out-of-the-box integration between Business Central and Dataverse is gradually improving. Still, many customers prefer to supplement or replace it with a custom solution. What are some things to keep in mind?

  • Licensing - Make sure that you have all the necessary Microsoft licenses. Many integration scenarios require premium licenses.
  • Prepare for sync issues - Sooner or later, data will get out of sync. Plan ahead and prepare user-friendly and reliable tools and processes that business users can use even without technical knowledge. On Resco's side, we've got you covered with robust and highly configurable synchronization; detailed logs, Sync Dashboard, etc.
  • Standard or small - Standard scenarios involving field service or field sales generally work satisfactorily out-of-the-box. If you are working on a custom scenario, consider starting small so that the complexity doesn't overwhelm you.
  • Competent partner - ERPs are complex systems. Bring in a partner with integration expertise.
  • Ultimately, each project is different. Select the appropriate integration strategy. Duplicating the data might require re-implementing complex business logic in Dataverse (and possibly Resco Mobile CRM). Virtual tables bring their own set of limitations.

Common scenarios

What are some of the common scenarios involving Resco?

  • Use Resco's flexible platform to design a custom feature. For example, travel expenses management, with Resco as the mobile client for tracking expenses, scanning receipts, and uploading them to the back office for further processing.
  • Use some of Resco's popular features, such as digital forms (Resco Inspections) or timesheet management.
  • Use Resco as the mobile client for Dynamics Sales or Field Service.