Skip to main content

Posts

Showing posts with the label D365O

Resolve Budget dimension through X++ [D365FO]

This one is to resolve budget dimensions. Be careful here to use the right class. Budget plan and Budget register use a different contract class. public static void getBudgetLedgerDimension() { //use BudgetPlanningContract for Budget plan //use BudgetAccountContract for Budget register BudgetAccountContract budgetAccountContract = new BudgetAccountContract(); budgetAccountContract.parmValues(new List(Types::Class)); budgetAccountContract.parmAccountStructure('Manufacturing P&L'); DimensionAttributeValueContract attributeValueContract; //Main account attributeValueContract = DimensionAttributeValueContract::construct('MainAccount', '110180'); budgetAccountContract.parmValues().addEnd(attributeValueContract); //Dimension 1 - repeat this for all other dimensions attributeValueContract = DimensionAttributeValueContract::construct('Departmen...

Resolve default dimension through X++ [D365FO]

This one is resolving the Default dimension public static void getDefaultDimension() { DimensionNameValueListContract dimensionNameValueListContract = new DimensionNameValueListContract(); dimensionNameValueListContract.parmValues(new List(Types::Class)); DimensionAttributeValueContract dimensionAttributeValueContract; //Dimension 1 - repeat this for all other dimensions dimensionAttributeValueContract = DimensionAttributeValueContract::construct('Department', '022'); dimensionNameValueListContract.parmValues().addEnd(dimensionAttributeValueContract); //resolve the dimension DimensionNameValueListServiceProvider dimensionNameValueListServiceProvider = DimensionNameValueListServiceProvider::newForDimensionNameValueListContract(dimensionNameValueListContract); DimensionStorageResult dimensionStorageResult = dimensionNameValueListServiceProvider.resolve(); if (dime...

Resolve ledger dimension through X++ [D365FO]

A bit of code to show how to resolve ledger dimensions. There are various codes out there but I thought I would write it in an easy way to understand. It is hard code but I did that for illustration purposes. public static void getLedgerDimension() { DimensionAttribute dimensionAttribute; DimensionAttributeValue dimensionAttributeValue; DimensionSetSegmentName dimensionSet; DimensionStorage dimStorage; LedgerAccountContract ledgerAccountContract = new LedgerAccountContract(); ledgerAccountContract.parmValues(new List(Types::Class)); ledgerAccountContract.parmAccountStructure('Manufacturing B/S'); DimensionAttributeValueContract dimensionAttributeValueContract; //Main account ledgerAccountContract.parmMainAccount('110180'); //Dimension 1 - repeat this for all other dimensions dimensionAttributeValueContract = DimensionAttributeValueContra...

Integration - Create a lead in CRM via a web service in 10 minutes

CRM (Microsoft Dynamics Online – not AX CRM) has an SDK which you could use to integrate to. It can been overwhelming sometimes. So, I decided to use Flow to do the communication for me (HTTP Request > Dynamics). Took me 10 minutes from start to finish. I didn’t have to learn the CRM SDK or figure out how to do authentication etc. I wanted to send a simple json message like this. {      "Email": "munib@fakeemail.com",      "FirstName": "Munib",      "LastName": "Ahmed",      "Topic": "Health" } Go to Flow and create a new HTTP request. Click on “Use sample payload to generate schema” and enter the above json message. It will generate a schema as per below screenshot. Take note of the HTTP POST URL that has been generated. We will use that later to send the message to. In the Actions select Dynamics > “Create a new record”. Select Leads as the entity name. Map the fields and you are done. Now we just ...

Run a class in background–Asynchronies mode

This is not much of a new thing but a reminder. I feel it should be used more often in D365fFO. In prior versions we showed a progress bar and gave the user a nice feeling that something was processing. In D365fFO we need better a way. If you look at the Data Management, it has a workspace for this. Process runs in async and workspace shows us the status. Code wise, it is pretty simple. Below is an example from standard code. I got it using “Find reference” feature in Visual Studio. Any info or error messages will appear in the message centre. This is great as the user can continue doing their job without waiting. Why am I writing about this? I had a project recently where the a process was taking minutes to run. Based on the amount of data and what it was doing, I found it acceptable that it ran that long. When the user was running it, they perceive it as slow and they are waiting on the screen to refresh. I used runAsync and what do you know – happy customer.

Analyse SQL performance issues using SQL Query Store for D365FO

Someone at work showed me this. With the production environment the Query Store is enabled. So when you bring it back to a sandbox environment. All that information comes with it. If you connect to the database via SQL management studio. Then navigate to the Query Store. There is a lot of great in depth information you could get. I have a customer that has gone live for 3 months and I wanted to see if there were any improvements we could do. Such as missing indexes we could add to our product. I won’t dive in too deep as there are some great resources online on how to utilise Query Store. I should mention a lot of this information shows up summerised on LCS. So that should be your starting point but I am really glad this is available.

Chain of Command–next() gotcha

UPDATE: 31/10/2017 Microsoft reached out and I have to correct my example code. It seems the compiler does not catch it when it is 2 nested conditions. See below code. Be careful when using Chain of Command not to place the next() call in a condition. Here is an example. Create a class extension for a form. Call the method init() but place it in an “if” condition. Something like this. [ExtensionOf(formStr(PurchReqCreate))] final class PurchReqCreate_EAM_Extension { public void init() { info("Outer - Before next"); if (this.args() && this.args().record() && this.args().record().TableId == -100) //intentionally made it -100 to not execute this code { //doing something here info("Inner - Before next"); if (this.args().record().TableId == -100) { info("Inside second if condition"); } next init(); info("Inne...

First look at Azure Functions

Azure Functions allows you to write code that can be triggered by an event or timer. You don’t need a machine to run it on. All the computing runs on the Azure cloud ie sevrverless computing. Below is a quick walk through. Keep in mind Microsoft has great documentation on their site. Just google it. In this post I will put a simple walkthrough. Save you from the information overload. Make sure you are using Visual Studio 2017. Create a project of type “Azure Function” Give it a minute to resolve the NuGet package. You will see a warning icon and watch it disappear by it self. Once its done. Right click and Add item. Select the type of function. The easiest to do is the Http trigger. This will create a class with some sample code. When you run it, it will run a local instance. Navigate to the URL and watch it run. There are many applications in the Dynamics space. Hopefully next time I can cover some Dynamics scenarios.

Table casting in AX 2012 and D365O

D365O is a lot more sensitive about casting or should I say AX2012 was too relaxed about it. This post is to show a specific scenario that works differently in the new version of the product. We had a bit of code that worked fine in AX2012 but stopped working in D365O. After debugging we found that when you cast a table it took the tableId of the cast. Below is an example of AX2012 vs D365O: UPDATE – Thanks for Joris for pointing this out. Same code running in CIL in AX2012. The piece of code in question was running client side. Otherwise, I would have noticed this in AX2012 too.

What’s new Dynamics 365 for Operations mobile app

This link shows the mobile workspaces that have been released. https://docs.microsoft.com/en-us/dynamics365/operations/dev-itpro/mobile-apps/mobile-workspaces-released However, I haven’t found the recent changes on the mobile app side. So, I decided to take a look my self. A few new features have been added to the mobile app since the last update. Now you can change company and sync history has been renamed to Notifications. Shows the list of companies. Stops if you there are unsynced changes. Regarding the notifications (previously sync history), it is now a lot more user friendly. You can drill through to show the record in question. Swipe to expose the delete button. Next time I will show a bit of the expense app.

Troubleshooting web service authentication Dynamics 365 for Operations

In this post I just wanted to highlight the event viewer logs on a developer box. Make good use of it – not just for web services but for most errors. Below is a recently problem I was troubleshooting. I was working on the Microsoft github integration project to do a proof of concept using odata. I had problems with the authentication. I was able to retrieve the token from Azure AD however the odata authentication piece failed with D365O. I got this error “Microsoft.OData.Client.DataServiceClientException: Unauthorized”  In debug I got down to this “Unknown user type” error. So, after looking at the event viewer. Expand Applications and Service Logs > Microsoft > Dynamics > AX-IntegrationCommon > Operational From the error I found that the tenant which is blurred was different. I had 2 Azure subscription. All I had to do what runt he Admin Provisioning tool against the tenant I wanted to do the integration with. Then all worked fine. Another way I could ha...

Dynamics 365 for Operations Security Analysis

I was recently looking at different ways of analyzing the security in the AOT. I found an Addin that is in Visual Studio. Click on the “View related objects and licenses for all roles”. It takes about 5 minutes to put all the data together and export an Excel file. You get two worksheets. License information – Shows the different security objects; Roles, Duties and Privileges. Showing the license type. View related objects – This is a detailed exploded view of the Roles, duties, privileges, resource (I.e. menu item) Based on the second tab I was able to create a pivot table. This allows me to figure out what makes a particular license Enterprise. The thing you have to keep in mind is that this is looking at the AOT. If you have made security changes in the front end, this Addin won’t recognize it. If you want to review security from the front end then navigation to the Security configuration form. Then click on the View permissions. You will get a similar list as the Ex...

SSIS support for AX OData connection

With prior versions of SSIS, the you couldn’t save online authentication with OData connections. If you wanted to use it, you had to wrap the messages using c# code. Now with the latest SQL 2016 update there was a nice feature that sneaked under the radar. The OData Connection Manager now supports five modes of authentication. Windows Authentication Basic Authentication (with username and password) Microsoft Dynamics AX Online (with username and password) Microsoft Dynamics CRM Online (with username and password) Microsoft Online Services (with username and password) Read more here on msdn https://msdn.microsoft.com/library/dn584133.aspx This is what the interface looks like. It will pop up with the sign in and will save it. This is a very exciting release.

PowerApp with Dynamics 365 for Operations #D365O

Recently, I spent I bit of time on PowerApps. Below is a walk through of my findings. Go to https://powerapps.microsoft.com and log in. This will take you through to the PowerApps dashboard. Here you can define your connection. This step requires that you authenticate to your D365O. Based on your email it will list all the D365O you have on your tenant. You can then create a new Application now. Click on Get started under the Create an app menu. First thing it comes up with is the connection. Select D365O and the Odata services will be listed. I chose to select the InventorySitesOnHand. Wizard will default 3 pages. List Details Edit You can change the layout and the fields easily. Just click on the page to change the layout. Click on the field to select or change the field. You can save your application. If you run it, it will give you a preview. Download the App on your mobile Now this below is from my personal android phone. PowerApps will list all the apps you...

Workflow configurable hierarchy #D365O

This was a nice find in the latest version of D365O. In workflow we can associate a hierarchy to a configuration. In pervious versions we where only allowed to select the one primary managerial hierarchy. A slider will pop up which you can select a hierarchy. In the assignments in AX 2012 we where only allowed to select the Managerial hierarchy. In D365O we can select Configurable hierarchy.