Secured_impulz, Author at Impulz Technologies LLC https://impulztech.com/author/Secured_impulz/ Microsoft Dynamics and Power Platform consulting company Mon, 22 Aug 2022 11:50:48 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 https://impulztech.com/wp-content/uploads/2022/08/cropped-impulz-tech-32x32.png Secured_impulz, Author at Impulz Technologies LLC https://impulztech.com/author/Secured_impulz/ 32 32 Microsoft Dynamics 365 Retail MPOS Customization https://impulztech.com/microsoft-dynamics-365-retail-mpos-add-custom-filter-in-order-search/ Wed, 10 Aug 2022 14:44:43 +0000 https://impulztech.com/?p=2530 Microsoft Dynamics 365 Retail MPOS: Add custom filter in recall order search Hello everyone, some time ago a customization request was raised from one of our Dynamics 365 Commerce clients to add a custom filter of ‘customer reference’ field from Dynamics 365 Finance and Supply Chain sales order in the recall order screen’s search options […]

The post Microsoft Dynamics 365 Retail MPOS Customization appeared first on Impulz Technologies LLC.

]]>
Microsoft Dynamics 365 Retail MPOS: Add custom filter in recall order search

Hello everyone, some time ago a customization request was raised from one of our Dynamics 365 Commerce clients to add a custom filter of ‘customer reference’ field from Dynamics 365 Finance and Supply Chain sales order in the recall order screen’s search options in MPOS.

The customization consists of two steps:

  • Adding the custom filter to the MPOS screen
  • Customizing the code in Dynamics 365 Finance and Supply Chain.

Adding the custom filter in recall order screen

In order to add the filter in recall order screen you have to create a view extension in the directory K:\RetailSDK\POS\Extensions\ if working in an azure hosted VM and for a local VM you have to do that in C:\RetailSDK\POS\Extensions\

Creating a view extension you have to perform a sequence of steps.

1. Start Microsoft Visual Studio 2017 or later as an administrator.
2. Open the ModernPOS solution from …\RetailSDK\POS.
3. In the POS.Extensions project, create a folder that is named RecallOrderSearch.
4. In the RecallOrderSearch folder, create a folder that is named ViewExtensions.
5. In the ViewExtensionsfolder, create a folder that is named SearchOrders.
6. In the SearchOrders folder, create a Typescript file that is named RecallOrderCustRefFilter.ts.
7. In the RecallOrderCustRefFilter.ts file, add the following code in the file.

8. You will now add the resource file for localization of the column name. In the SearchExtension folder, create a folder that is named Resources.
9. In the Resources folder, create a folder that is named Strings.
10. In the Strings folder, create a folder that is named en-us.
11. In the en-us folder, create a file that is named resources.resjson.
12. In the resources.resjson file, add the following code.

13. In the RecallOrderSearch folder, create a JSON file that is named manifest.json.
14. In the manifest.json file, add the following code.

15. In the POS.Extensions project, open the extensions.json file, and update it with RecallOrderSearch samples, so that the POS includes this extension at runtime.

After adding all the custom code clean and rebuild the project and start the project from visual studio it will show you custom changes in the recall order search bar.

Customizing the code in D365 Finance and Supply Chain

In order to customize the code in D365 Finance and Supply Chain we have to make changes in standard Microsoft service class RetailTransactionServiceTransactions. Microsoft provides delegates to handle different POS operations. registerGetListOrderSearchCustomfilterRanges delegate handle the custom filter which we added in the above steps.

For customizing the code you have to copy registerGetListOrderSearchCustomfilterRanges delegate and paste its signature in a new class RetailSearchOrderCustomFilterEvent to create an event handler. Then add the following code into it.

class RetailSearchOrderCustomFilterEvent
{
/// <param name=”customFiltersXmlElement”></param>
/// <param name=”extensionRanges”></param>

[SubscribesTo(classStr(RetailTransactionServiceTransactions), staticDelegateStr(RetailTransactionServiceTransactions, registerGetListOrderSearchCustomFilterRanges))]
public static void RetailTransactionServiceTransactions_registerGetListOrderSearchCustomFilterRanges(XmlElement customFiltersXmlElement, List extensionRanges)
{
container   conRange;
XmlElement  keyElement;
XmlElement  searchFilterValue, valueNode;
XmlNodeList childNodes;
System.Collections.IEnumerator iEnumerator;
str fieldName;
str filterValueStr;
int loop = 0, counter = 0;
if (customFiltersXmlElement !=null)
{
keyElement = customFiltersXmlElement.firstChild();
if(keyElement !=null)
{
fieldName = “CustomerRef”;
childNodes = keyElement.childNodes();
counter = childNodes.length();
for(loop =0; loop < counter; loop++)
{
if(childNodes.item(loop).name() ==”SearchValues”)
{
valueNode = childNodes.item(loop).firstChild().firstChild();
break;
}
}
if(valueNode !=null)
{
childNodes = null;
childNodes = valueNode.childNodes();
counter = childNodes.length();
for(loop =0; loop < counter; loop++)
{
if(childNodes.item(loop).name() ==”StringValue”)
{
filterValueStr = childNodes.item(loop).innerText();
break;
}
}
}
}
}
if (filterValueStr)
{
conRange = conIns(conRange, conLen(conRange) + 1, fieldName);
conRange = conIns(conRange, conLen(conRange) + 1, filterValueStr);
extensionRanges.addEnd(conRange);
}
}
}

Validate the customization

Follow these steps to validate the customization.

  1. Sign in to Modern POS.
  2. Search for customer reference by using the custom filter in the search options. You should see the custom column that you added.
  3. Filtered orders should be displayed in the grid.

The post Microsoft Dynamics 365 Retail MPOS Customization appeared first on Impulz Technologies LLC.

]]>
Custom Web Service in Microsoft Dynamics 365 Finance and Operations https://impulztech.com/custom-web-service-in-microsoft-dynamics-365-finance-and-operations/ Wed, 13 Jul 2022 07:44:16 +0000 https://impulztech.com/?p=2505 This blog describes the process of creating a custom web service in Dynamics 365 Finance and Operations. Introduction: Web services are basically Web APIs that are used to GET or POST data in D365 FO. There are some standard web services included in FO but users can create their custom web service to utilize it […]

The post Custom Web Service in Microsoft Dynamics 365 Finance and Operations appeared first on Impulz Technologies LLC.

]]>
This blog describes the process of creating a custom web service in Dynamics 365 Finance and Operations.

Introduction:

Web services are basically Web APIs that are used to GET or POST data in D365 FO. There are some standard web services included in FO but users can create their custom web service to utilize it in a third-party application.

In the following steps, we will define how to create a custom web service for creating a transfer journal from a third-party application through a web service in JSON format.

Initial Steps:

  1. Create a new model and project or utilize an already created project. Add a Data Contract class in the project which will contain the properties (table columns) needed for inserting data when creating a transfer journal in D365 FO.

2. Add the following code and define the Data Member Attribute properties in each parm method.

3. After creating a Data Contract class that will act as a model for passing the values in and out of web service. Now create a service class that contains the business logic of the web service. In our case, it will contain a Post method which takes data contract, extract data from it, and maps it into D365 tables.

 

Creating Service and Service Group:

  1. After the data contract and service class, you will need to create a service that will hold the class and expose its method as consumable APIs.

  1. Go into service properties and select the service class with which you want this service to be associated.

  1. After assigning the class add a new service operation in the created service and select the desired method in the properties. Service operations are basically the methods in the class which is exposed as getting and Post methods.

  1. Once the service is configured, add a service group. A service group contains a service or a group of service and act as an endpoint to call the exposed methods through external resources.

  1. Add the service created in the above steps into the service group.

Calling the web service:

To call the web service following URL will be used:

https://<D365 URL>/api/services/TransJourServiceGroup/TransJourService/createTransferJournal

Let’s break down this URL into parts.

  • https:// – This specifies we are making a secure call.
  • <D365 URL> – This should be replaced by the URL used to access your D365 environment. For example: https://usnconeboxax1aos.cloud.onebox.dynamics.com
  • api/services – This text tells D365 that we are calling a service.
  • TransJourServiceGroup – This is the name of the service group we are calling.
  • TransJourService – This is the name of the service we are calling.
  • createTransferJournal – This is the name of the method we are calling on the Service class.

 

Conclusion:

Through the above mentioned steps you can create any GET and POST type web service and integrate it into any external application using REST APIs.

 

The post Custom Web Service in Microsoft Dynamics 365 Finance and Operations appeared first on Impulz Technologies LLC.

]]>
Set up Git version Control for Dynamics 365 Finance and Operations project https://impulztech.com/set-up-git-version-control-for-dynamics-365-finance-and-operations-project/ Wed, 13 Jul 2022 07:18:16 +0000 https://impulztech.com/?p=2484 This blog describes the process of setting up Git as version control for the Dynamics 365 Finance and Operations project. Before starting to set up make sure you have Visual Studio 2017 or above and the latest Git installed on your system. Initial Steps: Create a new project in DevOps and select version control as […]

The post Set up Git version Control for Dynamics 365 Finance and Operations project appeared first on Impulz Technologies LLC.

]]>
This blog describes the process of setting up Git as version control for the Dynamics 365 Finance and Operations project.

Before starting to set up make sure you have Visual Studio 2017 or above and the latest Git installed on your system.

Initial Steps:

  1. Create a new project in DevOps and select version control as Git.

2. Then go to repos and create a new repository if a default repository is not created upon creating a new project.

3. Enter repo name and select type as Git. Select the add README option and select visual studio in the “Add a .gitignore” type selection.

Clone Repo & Setup Folder Structure:

  1. Access your D365 Finance and operations development environment and open Visual Studio as an administrator
  2. Open Team Explorer and select the plug icon then select Manage connections and then select Connect to a project

 

3. Select the project and select connect. It might ask for credentials upon connecting, provide the credentials which you are using for DevOps sign In.

4. Clone the repository. You can change the clone directory. It is preferable that you create a root folder in C: drive and clone your project there.

5. Following will be the structure of the folder after cloning completes.

6. Add these three folders to the cloned repo directory.

7. Create a power shell script using the provided script with the name “Mount” in the scripts folder.

Mount

8. Go to team explorer in Visual Studio and select Changes.

9. Commit the initial changes.

10. Push these changes to the DevOps repository.

11. After the above steps create a new custom model with the project in D365 Visual Studio.

12. Stop the AOS service in IIS Manager. Then in the PackageLocalDirectory cut the newly created model folder.

13. Paste it into the Metadata folder created in the above steps.

14. Delete any app folder and bin or Xref files if exists in your model’s folder.

15. After these steps open a PowerShell command prompt as admin. Run the Mount.ps1 file created in the above steps. The project will be linked to source control and any changes can be pushed to the repo.

For Existing Model:

If a Project/model is deployed through a deployable package or imported through a axpp file it can be added into source control through the same process just skipping the new model creation step.

The post Set up Git version Control for Dynamics 365 Finance and Operations project appeared first on Impulz Technologies LLC.

]]>
Microsoft Dynamics 365 Finance and Operations Business Events https://impulztech.com/microsoft-dynamics-365-finance-and-operations-business-events/ Wed, 13 Jul 2022 06:23:24 +0000 https://impulztech.com/?p=2466 Innovate everywhere with intelligent business applications When we think of Microsoft Business Applications, there is a diverse array of software applications that integrate with each other in perfect harmony. This enables solution architects to organize a perfect solution using the Microsoft platform. As consultants, power users, and decision-makers we should be aware of these technologies […]

The post Microsoft Dynamics 365 Finance and Operations Business Events appeared first on Impulz Technologies LLC.

]]>
Innovate everywhere with intelligent business applications

When we think of Microsoft Business Applications, there is a diverse array of software applications that integrate with each other in perfect harmony. This enables solution architects to organize a perfect solution using the Microsoft platform. As consultants, power users, and decision-makers we should be aware of these technologies and how they can be used to increase productivity in their projects or organizations.

This blog is divided into two parts dedicated to sharing knowledge of D365 Finance and Operations Business events’ introduction to implementation.

In this part, we are discussing business event introduction, categories, and their uses.

Introduction:

Business events provide a mechanism that lets external systems receive notifications from Finance and Operations applications. In this way, the systems can perform business actions in response to the business events.

Business events occur when a business process is executed. During a business process, users who participate in it perform business actions to complete the tasks that make up the business process.

A business action that a user performs can be either a workflow action or a non-workflow action. Approval of a purchase requisition is an example of a workflow action, whereas confirmation of a purchase order is an example of a non-workflow action. Both types of actions can generate business events that external systems can use in integration and notification scenarios.

The main objective of this framework is to send out notifications outside dynamics to tell the external systems that something is happening in dynamics. Now as the name suggests a business event is an event that has a business meaning attached to it.

Example:

Consider a scenario where a sales quotation has been confirmed and it became a sales order. In this situation, you might notice your sales team. That is where you might need to integrate with third-party applications. Instead of writing code or customizing D365 F&O to call those APIs, we can use a business event framework to send out this notification outside D365 F&O, and listeners who are listening to this notification can take some actions which they want to take.

This is the form that displays all the business events in Microsoft Dynamics 365 F&O. List of business events available out of the box, Microsoft added more events with new releases. On the left side are the fields that get sent out in the notification of this business event.

Business event has categories. There are three major categories.

  • Alerts
  • Business Events
  • Workflow

Alerts:

Alerts can be captured as business events and this becomes a very powerful and generic platform because alerts can be configured throughout the application in various forms.

For Example:

Alerts can be captured as due date alerts for example customer invoice is due in three days and you have set up a due date alert. You can actually send out notifications from outside dynamics and the listener can send the SMS to your customer. You do not need to customize such scenarios.

Business Event:

This category is all about the business category for example account receivable, accounts payable, and purchase orders. All these modules have their business events.

Work Flow:

Workflow is a framework within D365 F&O for approval mechanisms and you can send out the workflow notifications from outside the application.

Uses and benefits

Procurement

When you use procurement business events it easy the communication process between the office team and the production team when the production order is created and the floor team will notify by a third-party application so they can speed up the process of production.

Customer master

When a customer is created you can enter the credit limit/due date in the customer master. When an invoice is due then a business event will trigger and notify you on your mobile SMS.

Sales Order

This allows businesses with third-party warehouses application to send the picking information to the system. This can also be used if the warehouse has automated picking machines that determine what is required. This approach puts the responsibility of prioritizing picking and utilization on the external system and simplifies the setup in the application.

How to configure Endpoints

Endpoints are the listeners to these business events. You can configure your endpoints. When you go to configure the endpoint, you will see the list of supported endpoint types. These are the standard available endpoints that can listen to the business events also you can add custom endpoints as well. When a business event occurs and there is an active endpoint the payload gets sent out. In case the endpoints are down it will be captured in the error log.

Create a Business Event Endpoint

Let’s start and set up an “Endpoint” which is where our business event setup will be sent to.

  • Step 1

Open the endpoint tab and click new

Specify the endpoint type. There are many different types of endpoints that the system supports, including sending the messages to AZURE, Microsoft power automate, and a custom https endpoint

For now, I am setting up an HTTPs endpoint. Select HTTPs from the list and then click Next.

Configure Business Event Endpoint

You will fill in the 5 pieces of information on the next form. We will go through each one and how to find their values in the Azure portal.

  • Endpoint name

This is the name of the endpoint, and you can specify whatever you want.

  • Azure Active Directory application ID

Access portal.azure.com and sign in. Go to azure active directory, then registrations.

In the list, select the app that is used by your D365 instance. When the application is open you will see the value next to the application id. It is this value that you need to use in this field.

  • Azure application secret

This field should be populated with the ‘client secret ID‘ of your Azure active directory application found in the previous step. You need to use the value you wrote down when the Azure app registration record was created

  • Key Vault DNS name
  1. From the Azure portal menu, or from the home page, select Create a resource.
  2. In the Search box, enter Key Vault.
  3. From the results list, choose Key Vault.
  4. On the Key Vault section, choose to Create.
  5. In the Create key vault section provide the following information:
    1. Name: A unique name is required.
    2. Subscription: Choose a subscription.
    3. Under Resource Group, choose to Create new and enter a resource group name.
    4. In the Location pull-down menu, choose a location.
    5. Leave the other options to their defaults.
  6. After providing the information above, select Create.
  7. Go to the access policy and provide the desired permissions.

  1. Set the Connectivity method on the ‘Networking’ tab.

 

  1. Review settings and click Create.
  2. Lastly, click on the ‘Overview’ tab of your key value, and copy the value in the ‘DNS Name’ field.  This is the value you will enter into the ‘Key Vault DNS Name’ field when setting up the business event endpoint.
  • Key Vault secret name

If you have not already created a key-value secret, perform the following steps:

Add a Secret to the Azure Key Vault

  1. From the Key Vault click on the Secrets tile.
  2. Under Secrets, select Add.
  3. Under Create a secret, from the list of Upload options, choose an option with which you want to create a secret. Select Manual.
  4. Enter a Name for the secret. The secret name can contain only alphanumeric characters and the hyphen (-) character.  This is the value that you will need to use in the ‘Key vault secret name’ field when setting up the business event endpoint.
  5. Enter the https URL that you would like the business event message to be sent to, in the Value field of the secret.
  6. Select Create to start the deployment.

Go back inside the D365 form, and fill out the ‘Configure new Endpoint’ form with the values you have discovered.  Then click ‘Ok’ to create the endpoint.

You will now see your endpoint listed on the endpoints tab.

Implement the Business Event

As we previously configured the endpoint for D365. Now you will activate the D365 business event and then connect to the endpoint setup. This will cause business event messages to be sent to the endpoints.

Go to

System Administration > Setup > Business events > Business events catalog

Select the business event you want to activate. I have selected the business event Id “SalesInvoicePostedBusinessEvent”.

This will trigger whenever a sales order is invoiced.

Next, select the Activate link’:

A dialogue box will show up. Enter in the legal entity and endpoint that you want the business event to be sent to. Then specify the endpoint name and click Ok.

Select the Active events tab and verify that the business event is indeed activated.

Setup Business Events Batch Job

There are still a few more steps that must be taken in order for the business events to work at all.  By default, they are not enabled in the D365 system.

Go to the ‘Business events parameters’ form in D365

Check the ‘Use business events batch job’ radio button.  The link ‘Business events batch job’ will become visible.  Select the link to open the batch job dialog form.  Fill the dialog and make sure to set up the batch job to run with a re-occurrence.  This job will be responsible for processing the business event messages and sending them out once they are created.  So, for testing purposes, set the re-occurrence to something like 1 minute.

Enable D365 Business Events at the System Level

There is still one more thing needed to enable business events.

Open SQL server management studio and connect to the ‘AxDB’ database.

Then run the following SQL statement:

Update Business Events Parameters set Enabled = 1

Microsoft has a second ‘Enabled’ flag that is not visible on the Business events parameters form, that can only be set through a SQL statement.

Validate the Events are being processed

Now test out the business event functionality. Run the functional process that triggers the business event.  In my case, I activated the business event that will trigger when a sales order is invoiced.  So, we will create an invoice a sales order.

Verify that your business event by checking the table BUSINESSEVENTSCOMMITLOG.

If you check the BUSINESSEVENTSCOMMITLOG table right after you invoice the sales order, you will see a message staged in this table.

Next, depending on the reoccurrence setup, the business events batch job will run and process the records in this table.

If your business event is processed successfully, it will be removed from the BusinessEventsCommitLog table and sent to your endpoint.  If there is an error, the record will still be removed from the BusinessEventsCommitLog table and a new record is created in the BusinessEventsExceptionLog table.

To check the exception, go to the Business Events catalog form in D365, and then click on the Errors tab.  There is an exception message that will tell you what error occurred.

 

The post Microsoft Dynamics 365 Finance and Operations Business Events appeared first on Impulz Technologies LLC.

]]>