Friday, 25 November 2016

Dynamics 365 for Operations mobile platform–Part 3

This post I will explain how actions work. How to create a new sales order via Actions.

On the sales order click on Actions. Then add an action.

image

Click on the new sales order button and start recording your screen. I selected a few fields that I wanted to add.

image

Go to the mobile and refresh.

image

Lookups have to be linked too. This can be done by clicking on the field and then hit the properties.

Notice how you have to have an existing page. I ended up creating a customer page and linked the fields.

image

Date look up appear like so

image

This will sync the action back to the system. If there are any sync issues, just navigate to the Sync history.

image

You don’t get a detailed error message. You get sync failed due to an error. That is why I have to emphasis keep it simple.

image

Wednesday, 23 November 2016

Dynamics 365 for Operations mobile platform–Part 2

In the previous post, I showed my first experience with downloading the application. In this post, I will give some examples of setting it up.

First enter the url with &mode=mobile

https://myfakeaos.cloudax.dynamics.com/?cmp=usmf&mi=DefaultDashboard&mode=mobile

On the top right menu you will see Mobile app.

image

This will slide through the configurations pane.

image

Click on Add and create your first workspace.

image

 

image

I navigated to the form I want to record. I went into the On-hand inventory form.

image

Clicked on Select fields button and these orange + signs came up. Select the fields you want to display on the mobile device.

image

Click on the Done buttons. Then click on Publish workspace.

image

 

image

Refresh the mobile app.

image

image

 

image

This would have been really cool if it worked but I had a issue. It only displayed 1 item in the list.

The onhand form is very complicated and has a lot of dynamic features. Hiding and showing inventory dimension. So, I would recommend creating your own simple inventory on hand form which doesn’t have the complications of the standard form.

image

I did the exact same thing for the Released products and it worked fine.

image

Tuesday, 22 November 2016

Dynamics 365 for Operations mobile platform–Part 1

This is my first attempt at the mobile solution. Here are some findings.

I downloaded the Android version which you can download from the Play Store.

Have a read of the wiki site. It is well written.

https://ax.help.dynamics.com/en/wiki/mobile-development-handbook/

First thing you will get is the sign in screen.

Enter the URL for Dynamics 365 for Operations. Enter the company code. The application is company specific.

image

Accept the terms and conditions.

image

You will be navigated to the login screen.

image

Allow access to your media on your device.

image

You will be presented with a blank workspace and some menu options.

image

Next post I will write about configuring it.

Tuesday, 15 November 2016

Part 1–Create an Azure IoT Hub and Device

This is not AX but this was a nice experience. I worked through some labs to interact with Azure IoT Hub.

There is a lot of information out there on the web. So, I will focus on the the IoT Hub only here. On later dates, I may get into the other features of the IoT services in Azure.

Below are the steps to create a device in IoT Hub to get you started. After you have created your device, you can interact with the device in multiple ways.

Go to Azure and Create a new IoT Hub App.

2016-10-29_12-20-27

Enter the required information.

2016-10-29_12-21-50

Now you can Add Devices manually through the Azure Portal. Otherwise, you can use the SDK to add the device via code.

image

Now, I will show how to add the device via C#. Create a new Console project.

Add the reference via NuGet.

2016-10-29_12-27-16

Search for Microsoft.Azure.Devices and Install it.

2016-10-29_12-26-59

2016-10-29_12-27-41

Below is the code to copy and paste. Make sure to change the connection string to point it to your IoT Hub.

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Azure.Devices; using Microsoft.Azure.Devices.Common.Exceptions;

namespace CreateDeviceIdentity { class Program { static RegistryManager registryManager; static string connectionString = "HostName=DAXIOTHUB.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=xxxxxxxx"; static void Main(string[] args) { registryManager = RegistryManager.CreateFromConnectionString(connectionString); AddDeviceAsync().Wait(); Console.ReadLine(); } private async static Task AddDeviceAsync() { string deviceId = "myFirstDevice"; Device device; try { device = await registryManager.AddDeviceAsync(new Device(deviceId)); } catch (DeviceAlreadyExistsException) { device = await registryManager.GetDeviceAsync(deviceId); } Console.WriteLine("Generated device key: {0}", device.Authentication.SymmetricKey.PrimaryKey); } } }

Credit to Microsoft for the Labs. Lab doc I found was a little old but most of the steps worked.

Reference:

https://azure.microsoft.com/en-us/documentation/articles/iot-hub-csharp-csharp-getstarted/

Friday, 11 November 2016

AX 7 Working with Version control

This is the landing page for setting up your development environment with version control.

https://ax.help.dynamics.com/en/wiki/using-development-tools-in-ax7/

This is relatively easy and setting up a new solution/project works without a problem. In this post,I want to highlight a little gotcha. If you open up a solution and notice the project isn’t bound to version control. i.e. No padlock icon, not able to check out

Then it looks like you may have to bind the solution. Open up the solution using source control explorer. You should get this message asking you to bind it. Click on Yes and follow it.

image

Following screen you get.

image

Otherwise, create a new solution that and make sure to tick the “Add to version control” flag in the dialog.

Right click context in AX7

In previous versions we had the ability to override showContextMenu to achieve right click in various controls..

This used have pop the menu and wait for a user response to continue. This concept of waiting for a response doesn’t exist in AX7. So, it has been split into two methods:

  • getContextMenuOptions
  • selectedMenuOption

Do a search in the AOT for code examples it’s relatively straightforward.

Monday, 24 October 2016

Referencing a form control [AX7]

I am seeing this a lot more these days because of extensions in AX7. You tend to take the form run in the event and try to get a form control.

A lot of developers seem to be hard coding the control name. Not wrong but not the best way to do it. A form control name could change or be deleted. Then you wont catch this until a user runs it.

Not so good way:

formRun.design().controlName(“MyControlName”)

formRun.design().controlName(identifierStr(MyControlName));

The right way:

formRun.design().controlName(formControlStr(MyFormName, MyControlName));

This way you get your errors during compile time.