Serial Port null from SerialDevice.FromIdAsync(dis[0].Id) with windows UWP & FTDI adapter

Whilst on a laptop the following code fails whereas it is working on the RPi2. The serial port is provided by a USB to serial adapter, a USB FTDI adapter.
var aqsFilter = SerialDevice.GetDeviceSelector();
var dis = await DeviceInformation.FindAllAsync(aqsFilter);
serialPort = await SerialDevice.FromIdAsync(dis[0].Id);
serialPort is null when a break point is put after the last line, but is correct when running the RPi2.
I updated the driver in device manager for the adapter, but it still failed. After following several other posts on the internet and failing I then, after an hour or so discovered the following stack overflow post:
The key was to also update the USB Serial Converter as well as the COM driver. Do this by uninstalling the driver after right clicking it. Make certain that  the check box is selected to delete the driver.
USB Serial Converter
Scan for hardware changes will then install an updated driver that allows the serial port to be found by ID.
So running the original code it now finds the serial port as expected.


Hacking the suggested items feature in GP to create a flexible sales scripting system

In telesales, and ecommerce we have three common directions to take a sale:

  • Cross selling
  • Down selling
  • Up selling

The Suggest Sales Item window by default design is intended to suggest other items that could be added to the sales order, on the basis of a trigger item being added to that sales order. A good example of this is when ordering a torch (flashlight), you would normally expect to be able to make a sale of some batteries compatible with it (cross sell). A window in GP would pop open on entering the torch as a sales item, thus prompting the user to to add a quantity of batteries. If the customer and user choses to accept the batteries, then those items are added to the order.

What about down sells? Say you don’t have enough stock to fulfil the customer’s requirement so want to offer a lesser alternative or perhaps the customer baulks at the price and you need a cheaper option? Item maintenance provides two substitute items that can be entered against the item, so the user can check these should that circumstance arise.

If you wish to increase margin on a subset of product by encouraging sales of a slightly higher margin product, or perhaps have excess stock of an alternative product, this is selling up. Prompting the sales staff to move this stock in favour of the entered stock can be helpful. However it may be more of a fuzzy link that is required, not so one to one in nature. On buying the torch we want to get the sales staff to promote hi-vis jackets and personal protection equipment, but the range is large and direct links to items is inappropriate, the need is to simply prompt the sales person to start a conversation. How do we achieve this?

It is helpful that the suggested items window also has a sales script associated with the product suggestion link. This is a free text field where any message can be written for the user to read, using this in combination with a “fake/dummy item” we can do all kinds of fun stuff! It is a good idea to reserve a range of item codes for this purpose.



Lets create “00-095” as an item with description of “Sales prompt”. Create it as a flat fee or similar non-inventory item and create a prices of zero for it.

Item maintenance window showing sales prompt item

Now for the trigger items we want to prompt against, go to the Suggest Items button on item maintenance window in GP.  Add the item we just created (sales prompt) and type the script that holds the communications of what the user should be doing/saying. This can be up to two hundred and fifty characters. Then set the suggested quantity to zero as this is irrelevant in how the window is being used here.

Suggest sales item mainteance showing script to sales person

Entering the test item now prompts the user, note the script, contains what we want the user to do. Users can be trained to always read the “Sales Prompt” item’s script and act on it.

Sales order entry prompt shown with script entered

This technique provides for a useful way to prompt sales users during order entry. A number of prompt items could be generated with different names, like “Hazard prompt” or “Shipping Note” or “Limited availability”, to prompt of items that may need special handling, items that have shipping restrictions on them or perhaps just a notice of the fact the item coming to end of life. The scripts are stored individually against the trigger item so each item can have a different variation of a script, should that be required, leading to lots of flexibility in how this can be applied.


Now we have prompts, but with over 30,000 products these prompts need automating or someone is going to be full time maintaining them!

Tables IV00400 and IV00401 manage the sales prompts.


IV00400 controls the “check boxes”, as to what documents should trigger the prompt.

IV00401 is the more interesting table, this is the table into which to squirt the scripts and product relationships.

The following example replicates what was just shown using the user interface only this time using SQL to create the relationships:

-- Generate the next SEQNUMBR 
-- for this prompt type to keep them at the bottom of the item list

WITH CTE_LineNumber
AS (
FROM IV00401
,ISNULL(CTE_LineNumber.NEXTSEQ, 16384)
'Sales Prompt '
,CONVERT(VARCHAR(10), getdate(), 20)
,'Promote the Westway high-vis jackets or other PPE items for April sales push'
FROM IV00101
WHERE ITEMDESC LIKE '%flashlight%'
Obviously this is just a sample, complete SQL clears down old scripts and merges into the tables for updates. It is also worth noting here that the actual product description can be hacked to whatever you wish here too. So “Sales Prompt” has had the current date appended to it, alternatively this could be used to eek out more text for the messages. Be aware though that if a user does add the fake item to the order, this text may leak out to the customer as the item added will use the description from the suggestions table.
It is worth pointing out a bug or feature of suggested items is that the product description is not maintained in the suggestion table, hence if the description is changed on the item card, from my experience this is not updated in the suggestion table. Should the suggested item be added to the order, an out-dated description will be used on the sales order. This limitation can be addressed by syncing the two description manually or using SQL job whenever a description is updated. Perhaps this may be fixed in future releases, in that case hacking the suggestion description as described above may not be good practice.
It is easy to see how a SQL job could generate scripts overnight for products during certain date ranges for promotional activity or for items meeting certain criteria, such as stock levels and life time or shelf life, weight etc. This could be harnessed to drive sales more intelligently.
Careful use of the part numbers used for the fake, dummy item scripts allows for easier management when there are large quantities of scripts in use.

Installing both msi & msp package together for Dynamics GP “R2” versions

For those with network deployment to consider, around one hundred machines we do, then Dynamics GP has a neat feature to “Create Installation Package”, which does just that. By selecting the option from the installation media it will package up the local fully configured GP client into an msi installer package that can then be used to install the fully configured GP client for other machines in the environment.

Generating an msi installer makes the operations team happy as they can push the msi using network management tools such as System Center Configuration Manager or in this case PDQ Deploy to the client machines that require it. Together with a colleague from the infrastructure team we stumbled our way to a solution that we are sharing here for ourselves and others to reference.

GP Media installer main page highlighting Create Installation Package

When used with GP2015R2 (or orther R2 version), the installation package is generated an .msi and a subfolder named updates that contains an .msp file (patch installer file).

Simply installing the msi will only install GP2015 client, launching the GP client after install will result in a white launch splash screen and it will clearly say version 14.00.0524 on the login screen. This is clearly not the R2 version, the package generator has created the base GP2015 install and then generated a separate patch file to take it to R2, the patch is in the updates folder.

Now try installing the .msp file, the client is upgraded to GP2015R2. When GP is launched the newer blue splash screen will be shown and version 14.00.0725 will be shown on the login screen.

If the requirement exists to push an install of GP2015R2 direct, not via GP2015, say for new client installs, rather than upgrades, then perhaps the ops team could run both installers in a serial fashion. However better way is to run the following command on the output GP packages;

msiexec.exe /a GreatPlains.msi /p Updates\MicrosoftDynamicsGP14-KB3063038-ENU.msp

This will suck the .msp patch file into the main installer file, making for a much quicker install and makes the deployment so much simpler for the software management infrastructure to push. Now only the newly merged msi needs to be deployed.

Dynamics GP 2015R2 & Dynamics GP 2016 Visual Studio Tools SDK download

Like many I’m used to just downloading my developer resources from MSDN subscriber downloads or MS Dynamics Customer source etc.

Cleaning up my machines I lost the SDK for Visual Studio add-in creation in Dynamics GP. After trying to web search for it I didn’t find anything but the links to the GP2013 versions.

Looking at the installation media, found it under:

GP2015 R2 MDGP2015_R2_DVD_ENUS\Tools\SDK\VS Tools

Installer for Visual Studio Tools folder for GP 2015R2

Hopefully this post will help someone else to remind them more quickly to check the media for this and other components like eConnect.

The media for GP can be downloaded from MSDN or other locations on the internet.

See this customer source page, you will need to log into your account to access it:

Product Release Downloads for Microsoft Dynamics GP 2015