Thursday, March 24, 2016

Transfer data between environments in AX RTW using LCS configuration manager

In my last post, I showed how to use Data management in AX RTW to Import/Export data. In this post, I will show how to use LCS to transfer data between multiple environments.

I have 2 AX RTW environments, one is on prem VM and one Azure hosted environment.

In following demo, I will transfer data from my on prem VM to Azure hosted environment using LCS.

Setp 1: Configure the export processing group as follows:



 Step 2: Export the data and generate the data package:


Step 3: Login to LCS and upload the data package in configuration manager:

Click on Add and create new package as follows:
After confirm your package will be uploaded for analysis as follows:


It takes few hours to complete the analysis, once it is finished it looks like below:
Now our package is ready for the deployment to any azure hosted environment.

Step 4: Apply the package to the environement of your choice.

Choose the company and click apply.

Step 5: Check the status in AX RTW and LCS.


A data project will be created in AX as well as import job will be scheduled. Once this automated batch job is executed, Data will be updated or inserted in AX RTW as shown in above screen shot.

You can also check the status of the Import in LCS configuration and data manager as  shown in above screen shot.

I can imagine more hassel free master data/ configuration management. Uploded data package can be applied to multiple environments/ multiple companies/multiple times.

In this demo, I have taken only customers, You can define 1 package with all the master data and configuration and keep it in LCS. Whenever you want to spin up new environment, Just deploy the new environement using LCS and apply the data package to get the data into system. In few hours you will be able to get the working AX 7 environment without much efforts or technical knowledge.

ISV's can give the configuration data/demo data for their solution in similar way. This will help reduce setup time drastically. 

Thursday, March 17, 2016

Warehouse Mobile Devices Portal for Microsoft Dynamics AX

In this post, I will cover how to configure mobile device portal for Dynamics AX RTW.

Follow the steps mentioned in here. Once you are done with the steps mentioned, You might still wont be able to login to WMS portal due to errors.

In that case you need to look at the event viewer for errors. They are described below with the resolution.

Error: "Unknown type"


Resolution: Make sure user details are correct in the Web.config. Details should look like below


Error: "Error validating credential, Password is expired"


Resolution: This scenario comes due to 2 cases
  • When you have created a new user, Azure provides a temporary password. You cannot login using this temporary password and needs to be changed. To do this you can login using your new user into any site where you have access for e.g. https://manage.windowsazure.com You will be asked to change the password. Once you change it you should be able to use this new user and password in WMS portal.
  • When you password is expired. In this case, follow the same procedure as above to update the password. After that you should be able to use this user for WMS portal.
Error: "Error occurred when processing web request. Status code: Forbidden"


Resolution: You get this error when, user is not added in AX RTW. Create a user and error will be resolved.

Error: "Error occurred when processing web request. Status code: Unauthorized"


Resolution: You get this error when user doesn't have proper role in AX RTW. Assign the warehouse mobile device user role.
Error: "The user or administrator has not consented to use the application with ID '<GUID>'. Send an interactive authorization request for this user and resource.


Resolution: When you login for the first time into WMS portal (in turn Native APP on Azure), User has to give consent before they can proceed. From what I understood, Till Jan/Feb you would not get this error if you give username and password from the code but there has been some updates and after that user consent is necessary. To give the user consent you need a C# solution. Follow the steps below to create a new solution.


Create a new console application.

Click on the tools-> NuGet package Manager -> Manage NuGet Packages for Solution.
Search for the nugget Package Microsoft.IdentityModel.Clients.AciveDirectory.
Install it for your current project.

Now copy paste the following code to program.cs in the project.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
UriBuilder uri = new UriBuilder("https://login.windows.net/<domain>.onmicrosoft.com");
AuthenticationContext authenticationContext = new AuthenticationContext(uri.ToString());
//request token for the resource - which is the AX URI for your organization. NOTE: Important do not add a trailing slash at the end of the URI
AuthenticationResult authenticationResult = authenticationContext.AcquireToken("<URL of Dynamics AX>", "<app id from Azure>", new Uri("<uri of App in Azure>"));
//this gets the authorization token, which needs to be passed in the Header of the HTTP Requests
string authenticationHeader = authenticationResult.CreateAuthorizationHeader();
}
}
}

Replace the <domain>, <URL of Dyanmics AX>, <app id from Azure > and <uri of app in Azure> as per your details. It looks like below:


Save and Run the console app(shortcut to run is Ctrl+F5).

A new window will pop up asking the user name and password.


Fill in your user name and password. Click on sign in. A new screen will appear asking for the consent. Click accept.

Now you should be able to login to WMS portal.


Choose your company here.

You may get error like below:


Resolution:
Naviagte to Warehouse management -> Setup -> Mobile device -> Mobile device display settings and make sure record is created as shown in the screenshot below



Name : <anything>
Default checkbox : Selected
CSS file: defaultrf.css
Mobile device disply settings: DisplayIEOS

Now if you refresh the WMS portal site, you should be able to login:




Login to New Microsoft Dynamics AX RTW with different users -Part 2

In my last post, I have shown how to add new user in AAD and user in AX. In this post I will cover how to create users in AX RTW from different AAD.

Suppose you have users in different Azure Active Directory Domains.
In following screenshot, I have created a new testvinitg.onmicrosoft.com domain and a test vinitg user.


To give access to this user in AX RTW, create a new user in AX as follows:


Login using this user:


Wednesday, March 16, 2016

Login to New Microsoft Dynamics AX RTW with different users

In this post, I will cover how to manage users in Azure Active directory and user in AX RTW.

For login to new Microsoft Dynamics AX RTW, you need to have user in Azure Active directory.
To create new user, follow the procedure below:

Step 1: Login to Azure portal using the admin account.

https://manage.windowsazure.com/


Step 2: Create a new user using "ADD USER" button on the bottom. For this example I have created a new user 'ALICIA'.

Now login to AX using admin account.


Create new user as shown in above screenshot. You can also edit the existing user (in demo VM).
Use the alias which you created in step 1 (with your organization tenant).

Step 3: Now you can login using the new user with the role assigned to it.



Monday, March 14, 2016

Share link in Microsoft Dynamics AX RTW

In new Microsoft Dynamics AX, Sharing the form with filtered data has been made very simple. In each form under options, a new menu item is added -> Get a link.

 As shown in the above screen shot, I have applied the filter on the sales order list page. The copied web address looks like below:

https://usnconeboxax1aos.cloud.onebox.dynamics.com/?cmp=usp2&prt=initial&mi=display:SalesTableListPage&q=AQAAAHNm4l3JT6ikAPoAN%2f%2fzuzANlILUc2biXclPqKQA%2bgA3%2f%2fO7MA2UgtRCexg7P7ehAxeoykef1VEpZIDY5z4aEz%2favmvUHFxndM2BF8G3y%2fw1SbDMj55pnMlICLm4t4rY%2fNl9tlxvHWdI8ivBZCcRS801eGsCL7skthUBOy23sau4WcJCklkF%2bjSyQA5xBVCSwNhML6%2ftK8WtqiCjbXGq0STgWo%2fECQSJrSW5CZFIRAicT7BVMp380251Cy14JIhjGqMCU8W4x76qKuZXJmU52tsYqYQAdIy7tEujiI05uo9NrbbaeKrtLEC34Y8L%2bGawIXNWWL8u0owKfk4jyyjF%2ftGs42fbC1m4sUjBdy0d%2fsr27MLLekRqEkIAD2hM9K9shFa8qtpTR6JRPXYeaJYeJI3f%2bOLcUzQNWbDu4PvHyo4DR7nXfi4X%2fO6S6cSHvLoUujNxP4BrY7C%2fMp8x1FHXOm0DNtm5tdCgUEub5S0ppuWSEYJQai7p3y43LW5eFMO9AK8jY6JyjrK1fXudrQtL42VxA%2bhjfx05omSZQnpqi4OrJP4UcrfsveFKQk7mFZAVhL5Chfhnfp33KOrgnmcD%2bAV1QwwXz2pXcNZL3k8I23gK%2bAibAdtIYJXYDwl0E8Hyc3kkGOfeezfAWXN%2bAco0aElnKp2uagm3S1KTeI5jlr86%2fEAf6hhcHFKed8VmicJ8begpCpIYO3z0hXtEXijc9ags9KjPiEtaWLczvlI9vOlCKCP%2bvv%2bx%2fMl7UuUd8ZWA4kiyI89%2bSc3QaWe1Lb2pxjRpAyLB5Ahb%2bYAw7f6uvQY1bIfIbvz%2bvG6H9lu1d7oLnT096GlKRBE3VgKqeG0DhpKRvIp4cRm9VbIwdo%2bHOCYFVGCWIxq%2fkQuUiHMTUhZwQ39z9gbFrF1c


The query filter is stored in URL after the parameter "q". This is a great way to keep your favorite in the browser itself.



You can navigate directly to your most frequently used forms with filters already applied in a single click which will increase the efficiency for sure.

Sunday, March 13, 2016

Send a PO confirmation to vendor via email in new Microsoft Dynamics AX RTW

In this post, I will show how to configure SMTP server in new Microsoft Dynamics AX RTM and send the PO confirmation mail to vendor.

To sent the confirmation, we need to do the following:

Setup SMTP parameters.

Navigate to System administrator -> Email -> Email parameters



Set the values of following fields:

Outgoing mail server: aspmx.l.google.com
SMTP port number: 25
UserName: <gmail user name>
Password: <Password for sign in> 



For test purpose I am using gmail SMTP server. If you have your own SMTP server, you can use that.

Setup Print management settings for PO:
Navigate to Procurement and sourcing -> Forms -> Form setup



Click on the print management on general tab. In the print management form navigate to purchase order-> original default.


Click on the arrow as shown in the below screen shot:



 Set the email, CC subject and the file format in which you want to send the report. click ok.

Now you are ready to the PO to vendor:
Navigate to all purchase order.
Create new purchase order with required field and click on the confirmation.



Make sure you select the print purchase order and use print management destination. Click ok. Confirmation will be posted and email will be sent to your provided email id. 

Debuggin in new Microsoft Dynamics AX RTW

Debugging in AX RTW is similar to the debugging of CIL in AX 2012. In AX 2012, we used to attach the Visual Studio debugger to Ax32Serv.exe. In AX RTW, We attach the debugger to w3wp.exe service. This is IIS worker process.



Make sure you have unchecked the load symbols only for the items in the solution. If this is checked Visual Studio will load only dlls corresponding to files in the solution for debugging.  


Please note that when you uncheck it, It will take time to load all the dlls corresponding to AX RTW.

Friday, March 4, 2016

Export Sales orders in 5 easy steps in new Microsoft Dynamics AX RTW

In my last post, I have mentioned how to use OOB composite entity for Import/Export using Data management. In this post I will show, how to create your own composite entity. I am taking the example of Sales Order which includes Sales Header and Sales Line.

Step 1: Go to visual studio and create your custom model for Application Suite model.

Step 2: Customize the table SalesOrderHeaderStaging.


Create 2 new fields in table: RowId and ParentRowId. To create these fields, you can drag drop fields from BankJournalHeaderStaging, Similarly Create index RowIdx


Step 3: Customize the table SalesOrderLineStaging.


Create 2 new fields in table: RowId and ParentRowId. To create these fields, you can drag drop fields from BankJournalHeaderStaging, Similarly Create index RowIdx. Create a relation to SalesOrderHeaderStaing Table as shown below in the screenshot.

Step 4: Create new composite entity. Give it a name SalesOrderDataEntity. Add new root data entity reference: SalesOrderHeaderEntity and then New Embedded Data Entity Reference: SalesOrderLineEntity




Make sure Relation is set to SalesOrderHeader.


Step 5: Build the solution. Create the Export data entity as shown in below snapshot. 

Click on the Export and that's it. You can now download the file which looks like below: