Tip #47 | Understanding PowerShell resultsets

Whether you like it or not, if you want to be a succesful Dynamics NAV developer in the future you have to understand PowerShell. So do I.

Currently I am working on an integration project where we make an interface between an external solution and NAV using WebServices. Idea is to ship the software with Delta files instead of a fob.

So I am running my PowerShell and notice some differences between NAV2013R2 and NAV2015.

This is what I run:

NAV2013R2:

$MergeResult = Update-NAVApplicationObject -Target “C:\Users\Marije Brummel\Documents\DynamicsNAVNA71\Files\” `

-Delta “C:\Users\Marije Brummel\Documents\Delta\” `

-Result “C:\Users\Marije Brummel\Documents\New Object\” -Force

NAV2015

$MergeResult = Update-NAVApplicationObject -TargetPath “C:\Users\Marije Brummel\Documents\DynamicsNAVNA80\Files\” `

-DeltaPath “C:\Users\Marije Brummel\Documents\Delta\” `

-ResultPath “C:\Users\Marije Brummel\Documents\New Object 80\” -Force

As you can see the parameters have changed, but so has the resultset.

Unfortunately there is not much documentation on the resultset, only on the cmdlet parameters.

But I ran into a video from Bas Graaf taht shows this:

$MergeResult | Get-Member

This returns a list with the object members.

NAV2013R2:


Name         MemberType Definition
—-         ———- ———-
Equals       Method     bool Equals(System.Object obj)
GetHashCode  Method     int GetHashCode()
GetType      Method     type GetType()
ToString     Method     string ToString()
Conflict     Property   Microsoft.Dynamics.Nav.Model.Tools.ApplicationObjectFileInfo Conflict {get;}
Error        Property   Microsoft.Dynamics.Nav.Model.Tools.ErrorInfo Error {get;}
Id           Property   int Id {get;}
ObjectType   Property   string ObjectType {get;}
Result       Property   Microsoft.Dynamics.Nav.Model.Tools.ApplicationObjectFileInfo Result {get;}
UpdateResult Property   Microsoft.Dynamics.Nav.Model.Tools.UpdateResult UpdateResult {get;}

NAV2015:


Name MemberType Definition


—-        ———-   ———-
Equals      Method       bool Equals(System.Object obj)
GetHashCode Method       int GetHashCode()
GetType     Method       type GetType()
ToString    Method       string ToString()
PSPath      NoteProperty System.String PSPath=C:\Users\Marije Brummel\Documents\New Object 80\COD84001.TXT
Conflict    Property Microsoft.Dynamics.Nav.Model.Tools.ApplicationObjectFileInfo Conflict {get;}
Error       Property     Microsoft.Dynamics.Nav.Model.Tools.ErrorInfo Error {get;}
Id          Property      int Id {get;}
ObjectType Property string ObjectType {get;}
Result      Property Microsoft.Dynamics.Nav.Model.Tools.ApplicationObjectFileInfo Result {get;}
UpdateResult Property Microsoft.Dynamics.Nav.Model.Tools.UpdateResult UpdateResult {get;}

So as you can see (I hope) the Path is missing in NAV2013R2.

What I ended up doing is using the NAV2015 cmdlet for NAV2013R2 objects. There is probably a smart way to figure out a filename from the other properties.

Challenge for someone?

Marije

Toronto Master Class Application Architecture & Design Patterns

On March 23 and 24, the first Master Class for Microsoft Dynamics NAV Application Architecture and Design Patterns was held in Toronto.

Thirteen students attended. This what they had to say:

“I think this should be a mandatory class… developers who have the knowledge of design patterns and common coding practices inherently develop stronger, cleaner code.” ~ Michael Hollinger, Harbor Wholesale Foods

“An awesome course that covers the best practices of NAV development and application architecture.” ~ Sukeev Kailayapathy, Second Foundation

The workshop will be scheduled twice per year in Toronto (or on demand if enough students register). Your teacher will be Floyd Chan.

The workshop is scheduled for the following locations this year.

When Where Who
May The Netherlands Luc van Vugt, Marije Brummel
May Belgium Steven Renders, Marije Brummel
June Iceland Gunnar Gestsson, Marije Brummel
June Japan (Closed Partner Training)
June Romania (Closed Partner Training)
October United States (NAVUG, Reno) Marije Brummel
October Online NAVUG Academy Mike Doster
November Online NAVUG Academy Mike Doster

Master Class – Application Architecture & Design Patterns

During the workshop, we will reveal all the secrets that are hidden in the Dynamics NAV Source Code. You will get answers to questions like…

  • How is Dynamics NAV Architected and how do the modules communicate
  • What are Design Patterns and Anti Patterns and how do they apply to Dynamics NAV
  • How can I avoid conflicts during my object merge
  • What impact do monthly rollups have to my roadmap and release strategy
  • Can the new Delta Files help me get more organized
  • Why does Dynamics NAV have so much Code Cloning
  • Are the coding standard documented and how can apply them
  • Can I implement Object Oriented concepts such as MVVM, overloading and reflection
  • How do I organize my object structure
  • Best Practices such as Encapsulation and Natural Language Programming
  • Be familiar with over 30 most used Design Patterns in Dynamics NAV
  • What does a perfect UI look like to be repeatable in the cloud
  • Understand the impact of Meta Data on Software Design
  • What is the difference between Reservation Entries, G/L Entries and Interaction Log Entries

Course Outline

The course has four, iterative blocks that explain the elements for good software architecture using Design Patterns – Repeatable User Interface, Coding Guidelines, Architectural Principles and Exercises.

Introduction

  • Introduction to Application Architecture
  • Rollup update & Upgrade Strategies
  • Design Patterns & Anti Patterns
  • Meta Data Driven Software Development

Object Architecture

  • Define Object Hierarchy
  • Enhance the use of the Symbol Menu
  • Interfaces
  • Function Libraries
  • Natural Language Programming
  • Encapsulation
  • Arguments & Overloading
  • Façade & Hooks

Coding Guidelines

  • Design
  • Internationalization
  • Localizability
  • Readability
  • Data Dictionary
  • Hungarian Notation
  • User Interface
Design Patterns

  • Singleton, Multi Level Setup & Rules Pattern
  • Master Data, Entity State & Compound
  • Documents, Copy, Posting & Archiving
  • Test Near, Test Far, Do It, Clean Up

Code Cloning

  • Fundamentals
  • Transaction Mirroring
  • Forking, Templating, Customize & Exact Match

Modern UI for Repeatable Software

  • Instructions in the User Interface
  • Transaction Data Update
  • Hiding Fields & Fast tabs
  • Totals on Sub Pages
  • Create Data from Templates

Model View View Model

  • Working with Temporary Tables
  • MVVM Pages
  • Reports based on data in memory
  • Query data on Pages

My 10th MVP Award, a decade with the Dynamics NAV Community

Last wednesday I was a happy man. Around 4:30 CET I got an email from Microsoft saying that I got awarded as MVP. And this was the 10th time I got that email.

In those 10 years I had periods where I did not even notice that email because it went to spam until a few days later, or until my MSDN subscription (one of the cool benefits of the award) was discontinued because I did not renew it.

But this one is special. Being part of this journey for a decade now. A lot has happened in those 10 years that are a direct result of the award. Traveling to cool places, meeting interesting people, making friends and last but not least, learning how Microsoft works.

I am not easy to work with. After I finished my last book I apologised for being me to the project manager since I gave her a hard time, and I know I did. I am very strong in my opinions and it takes some serious effort to change those opinions.

The community has evolved tremendously in the last 10 years as has Microsoft in dealing with it. Most changes are great changes. Some are not.

Please keep a close eye on my blog or MSDynamicsWord. I am working on an article of how the community around Dynamics NAV evolved in the last 10 years and hopefully giving people a few tips and tricks in how to keep standing in the ecosystem that we know today.

Thank you for everyone that reads my blog, asks questions on the forums and visits my presentations at events all accross the globe.