Wednesday, November 19, 2014

Microsoft #reIMAGINE 2014 Conference - Wrap Up!

November 13, 2014

After a good 3 days of conference sessions (both attending and delivering), I have to say this event has been very special to me. Being able to catch up - yes, catch up! - with old (and not so old) time friends is probably one of the best experiences of this particular reIMAGINE 2014 event.

At Hector International Airport (FAR) Gate 1
As I sat at Gate 1 at Hector International Airport, looking out at the snow dusting collected on the tarmac (a stark reminder as to why I don't live in these latitudes), I reflect back on days past to highlight the following:

1. You MUST begin learning about Service-Based Architecture in general, now! The truth is, I spoke to numerous developers during this event and the one question that kept coming up was, "Where do I go to learn all this stuff?". It took me some time to get acclimated to these style of services, but frankly, you need to build on your past experience. After all the current Web Services model (SOAP based), while different from the new one (REST based) still offers some of the underpinning architectural elements. If you are a newcomer to the game, then the MSDN library offers quite a few good primers on REST based services. One of my favorites is An Introduction To RESTful Services With WCF by Jon Flanders. In subsequent days, I will be posting a number of articles on the Dexterity service patterns and their implementation.

2. The Microsoft Dynamics GP partner community is alive and well, thank you! It's no coincidence that this event drew close to 500 partners and ISVs. The question that still lingers in my mind is, why not more? These events are not all about the kumbaya and to be honest, the wealth of information is simply overwhelming at times and I'm surprised that, despite the number of attendees, more partners are not taking advantage of the learning opportunities. I am willing to wage a bet: if we get to double the registration for next reIMAGINE chances are this event will need to move to another city not named Fargo as there may not be any venues large enough to host such crowd.

3. The jury is still out on who throws the best event parties, but I must say there are only two clear competitors, so far: FastPath and eOne Solutions. If I'm going to be put in a position to choose... you know what? I will just continue to enjoy the parties, so go on boys and girls! Just let me know when and where I must show up to the next one.

4. Last but not least, this partnership between Microsoft and Dynamic Communities is probably the best darn thing to happen to the Dynamics GP ecosystem after Microsoft's acquisition of Great Plains Software. With Microsoft technologies and products and Dynamic Communities understanding of the user and partner ecosystem, these events just seem to have been catapulted to another level. What I would like to see is more collaboration at the session level, between Microsoft Dynamics GP development team members and partners. It would make for a very interesting perspective, from both the technical and the practical applications of the technology.

I also wanted to thank each and every single person that made this event possible - you know who you are! It's (fairly) easy to show up to these events as an attendee and sometimes as a presenter, but putting a partner event together is no easy feat, so kudos to the Microsoft Dynamics GP Product Management and Product Development teams and the Dynamic Communities team for a great event.

Coverage from this event appears in the following posts:

Microsoft #reIMAGINE 2014 Conference - Getting Here
Microsoft #reIMAGINE 2014 Conference - Day 1
Microsoft #reIMAGINE 2014 Conference - Day 2
Microsoft #reIMAGINE 2014 Conference - Day 3

Conference material can be downloaded from

See everyone at Microsoft Convergence 2015 Atlanta, my backyard. Register now to take advantage of the early registration rates and get some great accommodations here in town.

Until next post!

Mariano Gomez, MVP
Intelligent Partnerships, LLC

Microsoft #reIMAGINE 2014 Conference - Day 3

November 12, 2014

As the saying goes, "All good things must come to an end" and it was no different for the reIMAGINE 2014 conference. However, we still had to get through the day with the closing session, and couple breakout sessions we were responsible for.

After the fantastic keynote speech by Doug Burgum and some really fun partner hosted events at the local bars on the previous day, it was just natural to wake up with an appetite, so I was down early for breakfast - then again, so was everyone else!

Breakfast gathering
Breakfast preceded the closing session, which was once more MC'ed by Jesse Byam, who was going around the room asking folks about the highlights of their conference experience, all the while eating their breakfast. Jesse and I had a chance to interact on my own experiences and I have to say, all the Service-Based Architecture sessions I attended were the biggest takeaway for me.

After Jesse got the entire room pumped, Joe Carroll followed up with some closing words, basically highlighting the Microsoft Dynamics GP product trajectory over the past 20 years and how it has allowed him to grow professionally - Joe started out with Great Plains Software almost out of school.

Joe Carroll
Next up was Errol Schoenfish (sporting another cool ply shirt, making it his personal reveal) to conduct the Microsoft Dynamics GP Big Reveal surprise which would show off some of the next major milestones that Microsoft is working on as it relates to our beloved Dynamics GP.

Errol Schoenfish
Errol brought Jarred Hall to stage to demo off the next generation Excel Refreshable reports which is fully integrated to Microsoft Office 365. Jared had a chance to showcase a scenario where Excel reports were generated from GP and consumed directly on Office 365 without ever making it to the end-user's desktop, which is how the current proposition behaves. I have to admit, the next iteration of Excel refreshable reports is going to significantly enhance the user experience.

Jarred Hall and Errol Schoenfish
Next up was Jennifer Ranz, one of the coolest people over at Microsoft - sorry guys, I love you too. Her mission was to show off aspects of the next generation user interface and in particular the new HTML5 UI. While the HTML5 UI is still a long shot from anything resembling a beta product, it was encouraging to see some of the conceptual design elements being considered for the new UI.

Jen Ranz and Errol Schoenfish
HTML5 UI Prototype with our favorite client on display
Next, reIMAGINE took a turn for the better when Errol invited partners to talk about their own success stories in reimagining their business around Microsoft Dynamics GP. We had a chance to hear from John Hendrickson with InterDyn BMI and Matt Woodward with The SMB Suite. While both businesses went down different reimagining paths, it was clear to me personally that a diversified product and services portfolio, high levels of customer service, and taking advantage of different Microsoft programs propelled these two organizations to the top of their game.
John Hendrickson (InterDyn BMI), Errol Schoenfish, and Matt Woodward (The SMB Suite)
Errol concluded the session with a very emotional account of his son Tucker's basic and technical training in the Air National Guard at Lackland Air Force Base near San Antonio, Texas and how throughout the program, Tucker has developed some rigorous discipline and precision that have improved his life all around. Errol exhorted all attendees to the closing session to learn and improve their skills to continue reimagining their career paths.

Once the closing session was over, David and I quickly went to the Holiday Inn Board Room to get setup for the Become More Dexterous at Dexterity Development breakout session - a panel style session - which we would be hosting along with David Eichner with ICAN Software, Mark Rockwell with Rockton Software, and Microsoft MVP Leslie Vail. Unfortunately, Leslie was ill and could not present along with us, but we were able to get Patrice Bremond-Gregoire with BGE, Inc to fill in for Leslie. Patrice is a long time Microsoft Dexterity developer and runs a successful Microsoft Dynamics GP ISV firm in Canada.

This session was particularly cool, because no one on the panel prepared anything and it became totally interactive. There was no short of questions from the attendees and I believe we all had quite a bit of fun delivering some of our own tips and tricks to the audience.

Next up was our long awaited session, The Support Debugging Tool for Advanced Users. We were treated to a standing room only session, which is usually the way we like it.

SDT for Advanced Users
Courtesy of Dawn Prigmore
Although we had quite a bit of material to cover, the session went on with just some minor hiccups and everyone chanting YES IT CAN!, to the sometimes butchered question "Can the Support Debugging Tool do it?". Some of the topics covered in this session included the Automatic Debugger Mode feature with log traces, SQL Execute, Runtime Execute, and the (still in beta) Database Validation tool.

David showing off the Database Validation Tool
Courtesy of Dawn Prigmore
The session wrapped up and we spent a few additional minutes taking pictures and saying goodbyes to a number of attendees who walked up to greet us. After grabbing a box lunch at the meal room, we ran off to a Development Collaboration meeting at the Microsoft Campus. As this meeting was under NDA there's nothing I can discuss here. After the meeting, we were chauffeured by Emily Halvorson to the all too famous Carol Widman's Candy Company to get some Chippers (chocolate covered potato chips).

We returned to the Holiday Inn to drop off our stuff, then meet at the bar for a drink or two before dinner. Dinner had been pre-arranged at Passage to India with Jivtesh and Rubal Singh, Leslie Vail, John Lowther, Belinda Allen, Sheila Ochoa, Sheila Jefferson-Ross (the birthday girl!), and Emily Halvorson. We ordered a number of dishes to share among all of us and spent quite some time conversing and laughing while enjoying our meal.

Left Side: Leslie Vail, Sheila Jefferson-Ross, Mariano Gomez, Rubal Singh, John Lowther
Right Side: Jivtesh Singh, Belinda Allen, David Musgrave, Emily Halvorson, Sheila Ochoa

It's hard enough when you can't count American money.
Paying the bill took the better part of 10 minutes while David sorted through the notes
After dinner, we returned to the Holiday Inn, where surely one more drink was warranted after the delicious meal. As is customary, it was time for the now all too famous Tim Tam Slams, courtesy of David Musgrave. For a description of the all too embarrassing process, please visit this old post over at Developing for Dynamics GP.  However, when you are surrounded by characters such as Craig Klapman (Mekorma), John Lowther (Njevity), and Mike McDowell (Mekorma) doing Tim Tam Slams, you are bound to enjoy the show while handing out a few napkins. Stay tuned to David Musgrave's new blog as I am sure he will be posting pictures on this.

For my part, I was sitting on another table talking to my buddy Corey Clay, Sr. Tech Consultant with NexTec Group in Canton, OH. Corey had another day to spend in Fargo attending a couple of post conference training classes. Since him and I go way back, it was just about fitting to catch up after a long 3 days of conference, though he attended a couple of my sessions.

It was now time to call it a night as the following morning I would initiate my journey back home.

As is customary, please wait for my conference wrap up post with links to all the presentation materials for our sessions. This was a very exciting conference and I really hope to see more partners joining Dynamic Partner Connections and attending these type of events. The wealth of information is simply to die for.

Until next post!

Mariano Gomez, MVP
Intelligent Partnerships, LLC

Tuesday, November 18, 2014

Microsoft #reIMAGINE 2014 Conference - Day 2

Oh goodness, what happened last night? Well, it's true that if you are going to party into the wee hours of the morning, you must still get up to go to the conference and so I did.

Today was the first full day of breakout sessions, but David and I won't start our first session until the afternoon. I got up and downloaded Project Siena for the live demo I would be conducting during our session on building a Windows 8.1 App so I had just a few hours to learn the product. After obtaining the GP service XML configuration file from my buddy Kevin Racer the day before, the idea was to replicate the demo Kevin and Errol conducted on stage during the General Session.

David and I met at the Microsoft Campus around 10:30 AM and sat for a bit to go over some of the logistics of the interaction between the two of us during the session. As with all our presentations, the improv factor helps more with having a fun and relaxed time. So David went off to another session, while I decided I was too hungry, so I went and order some nice Indian food at the Microsoft Commons restaurant.

It was 2:30 PM and it was time for Service-based Architecture and Building Exciting New Customer Applications and Integrations. During the session we provided an abstract of the new Service-Based Architecture in Microsoft Dynamics GP and proceeded to talk about the different architectural patterns, and Dex serviceable components, without going into the details covered by previous SBA sessions and more looking at the possibilities from a developer's standpoint. The Siena demo went without a hitch and we also demoed the .NET interop capabilities in Dexterity through a Trigonometric functions example which can be found in my article Microsoft Dynamics GP 2015 Developer's Preview: .NET Framework Interoperability - Part 3.

After completing our session at 3:30 PM we wondered off campus and back to the Holiday Inn to relax for a bit before heading out to the Fargo Theater for the keynote speech.

The frigid afternoon would take us down to the Fargo Theater for the keynote speech featuring Doug Burgum, founder of Great Plains Software and former Sr. VP Microsoft Business Solutions.

Fargo Theater
At the theater, we grabbed a few popcorns and some adult beverages and went to find a seat close to the stage.
Jen Kuntz and David Musgrave
The evening had one more surprise for us. Prior to Doug taking the stage, the MC was no one other than Matt Gustafson, a.k.a., The Fabulous Matt G. For those of you new to the channel, you can read about Matt G in the farewell post over at Developing for Dynamics GP. Matt G, in his unique brand of humor, recruited Errol Schoenfish and

Matt Gustafson
"The Fabulous Matt G"
I will spare you the details on Doug's session, but suffice to say, it was another one of those exceptional keynotes that only Doug can deliver, full of historical references around the life and miracles of American inventor Clarence Birdseye, considered by many to be the inventor of frozen food. Doug expanded into the development and expansion of suburbia and how this phenomena has given way to dilapidated downtowns across America. However, the sustainability issues associated to the suburban expansion are giving way to considerations on reclaiming downtowns across the nation, given the newer generations' desire to stay close to their places of work.
Doug Burgum
After Doug's speech, I went up to take a picture and to thank him for (indirectly) providing me the opportunities I have had around Microsoft Dynamics GP. As a matter of anecdote, I visited Fargo in 1996 where I had the opportunity to talk to Doug one-on-one in several different occasions, as I helped my company back then to establish a product and a presence in Latin America.

A picture for the ages
From left to right: David Musgrave, Mariano Gomez, Doug Burgum, Leslie Vail, and Sheila Jefferson-Ross
Following the keynote, I headed down to Dempsey's Public House for my first stop in the tour through the bars and eateries selected by the sponsoring partners. Drinks at Dempsey's were sponsored by Microsoft partner Njevity.

I had pre-arranged dinner plans with the Barlett, Pringle and Wolf, LLP technology consulting team at Mezzaluna Fine Dining, which was right behind Dempsey's, one of the stops in the bar trail attendees could follow throughout the evening. Intelligent Partnerships - my company - and BPW have collaborated on a few challenging projects and are looking forward to more.

The atmosphere at Mezzaluna was eclectic with a hint of European flair. While I only had the bacon wrapped bison meatloaf, I must say that by far I consider it to be a fantastic dish - to the point where almost everyone on the table ordered it.
Dinner with Barlett, Pringle and Wolf Consulting Group
From left to right: Mariano Gomez, Ross Appenzeller, Michael Weaver, Stephen Korosy, and David Musgrave
The service was impeccable and certainly would recommend anyone visiting Fargo to head down to this place for dinner.

Next stop: HoDo Lounge, a part of the Hotel Donaldson. Drinks at HoDo were sponsored by eOne Business Solutions. As the temperature dropped even more, it was time to find the bus to return to the Holiday Inn and call it a night.

Until next post!

Mariano Gomez, MVP
Intelligent Partnerships, LLC

Monday, November 17, 2014

Microsoft #reIMAGINE 2014 Conference - Day 1

November 10, 2014

After my pleasant trip to Fargo on the previous day, it was time to check in and complete the registration process with the lovely ladies from Dynamic Communities. It helps to have a reputation in the community as my badge was handed to me without showing an ID.

Registration Desk
After registration and catching up the Dynamics Community folks I was off to get some breakfast. I quickly caught up with some of the most special people who have a big hand in making these events happen.

Amy Alley, Shanna Hensch, Andy Hafer
After grabbing some food and making it to my table, I caught up with my co-presenter David Musgrave, with whom I would be reviewing and fine-tuning the last bits of our presentations. The 11,000 miles separating us do not always cooperate with making things smooth from a delivery perspective. At the table, I also had a chance to catch up with MVPs Belinda Allen and Leslie Vail, while also sharing some stories with Sheila Jefferson-Ross and Jen Kuntz. Pam Misialek popped in before her conference opening session and it was all downhill from there. The opening session was animated by Jesse Byam who did an excellent job at keeping the room animated before the opening session.

From left to right: Pam Misialek, Belinda Allen, David Musgrave, Jennifer Kuntz, Sheila Jefferson-Ross, Leslie Vail
The General Session offered a unique opportunity to view some of the cool new functionality to be released in Microsoft Dynamics GP 2015, while revisiting the Microsoft Dynamics GP product roadmap and the different milestones for each 6 month release cadence.
Pam Misialek kicks off the General Session
Joe Carroll with Dynamics Communities joined Pam on stage to welcome everyone to Stampede to Fargo - ehem, reIMAGINE 2014! Joe sported on of his first Stampede to Fargo outfits and went on to reminisce about the past while offering insights into how far we have come as a community standing behind the Microsoft Dynamics GP product.

Pam Misialek and Joe Carrol
Next on were Jeff Trosen and Errol Schoenfish to demo the brand new cross-platform Business Analyzer application on the Apple iPad. Errol and Jeff reiterated Microsoft's commitment to develop applications that can be used across any platform on any device while taking advantage of the recent investments of the new service-based architecture components. Business Analyzer can now be downloaded from the Apple Store (via iTunes), Google Play, and the Windows Store.

Jeff Trosen and Errol Schoenfish
Next up were Jen Ranz and Chad Sogge. Jen and Chad did a role playing scenario where they were both wife and husband running a small business company taking advantage of the new service based architecture components via Office 365 and Yammer.
Jennifer Ranz and Chad Sogge
Following Jen and Chad's presentation, Jodi Christiansen and Brian Meier took the stage to talk about the more than 120 new features being incorporated into Microsoft Dynamics GP 2015. The truth is, there are so many of these that it's easier to refer you to the Inside Microsoft Dynamics GP blog site, maintained by the Product Management team for a day-by-day look into the new features.
Jodi Christiansen and Brian Maier
Next up were Errol Schoenfish and Kevin Racer to show off Errol's development skills. Kevin referred to Errol as "the least technically inclined individual on the Product Management team" and it sure made for a great intro, as Errol would move into creating a quick Windows 8.1 application with Microsoft's Project Siena development tool.

Errol Schoenfish and Kevin Racer

After the General Session, it was time for me to finally attend some sessions for once in the last 5 years at a conference and I was determined this would be it. First on my list was the Service Based Architecture Overview session with Kevin Racer and Chris Rudolph. { I'm finally convinced that Chris Rudolph's IQ is off the charts, but that's besides the point and probably not a subject for this blog, though I'll try to interview him soon for this blog! } - did I just use a Dexterity comment brace? Chris and Kevin delivered a very concise session on the SBA platform architecture components and how each component relates to each other: The GP Service, the Dex Service Controller and the different Dex processes that are spun up as a result of consuming the services.

My next stop would be the Enhanced .NET Interop session with Alice Newsam and Rob Anderson. Alice and Rob explained the Dexterity IDE enhancements to support .NET interop, as the basis for the new service architecture. Their session included various demos showing a host of possibilities, including a random line generator on a .NET instantiated WinForm, a Slideshow app, which, once given a path to some pictures, it's able to cycle these on screen, and finally a Speech generator, which uses the speech library to synthetize some text.

Next up was Michael Hammond and Yuri Mikeev to talk about Building Multi-device Mobile and Companion Apps. This session mainly focused on the development tools and components available in today's market to assist with mobile and companion applications development that would allow developers to take advantage of the current service architecture components. The guys conducted a review on tools such as Visual Studio Tools for Apache Cordova,

I finally soaked in the Service-Based Architecture: Deploying and Managing session with Crash Collison and Chris Rudolph. This session focused on the tools available to administer the service components, including the Microsoft Dynamics GP Security Tasks window and the new Management Console (formerly Web Management Console).

As you can imagine, by now (5:00 PM) my brain was cooked, so after all this SBA stuff it was time to find me some food and a party. So what better to head to the evening reception down at the Microsoft Campus. After some good food and some drinks, the party would continue at Shotgun Sally's courtesy of eOne Business Solutions. The name of the party? Smartner Party. If you missed the promotional video, here it is:

The band invited to carry us long into the night was Pop Rocks, which is a costume band with a high energy, high energy show. These guys really know how to keep the party going with all the flair on display during their show.

A little partying with the eOne team
The following is the group's promo video:

I highly encourage anyone to hire these guys for their next corporate party.
Final note: No pictures of this event were posted to protect the identity of the not so innocent.

Until next post!

Mariano Gomez, MVP
Intelligent Partnerships, LLC

Monday, November 10, 2014

Microsoft #reIMAGINE 2014 Conference - Getting Here

November 9, 2014

Typically, there's nothing exciting about a flight between Atlanta - Minneapolis - Fargo, except this time, I was able to appreciate the art exhibit displayed between T gates and concourse A at Hartsfield-Jackson Atlanta International airport.

Foreground: TRAVELING FAMILYBy Amos Supuni
Born 1970 Malawi

Background: GALACTIC DANCERTapfuma Gutsa
Born 1956 Harare, Zimbabwe

This permanent collection of twenty contemporary stone sculptures from Zimbabwe debuted in 2001 and is one of the largest publicly owned and exhibited collections of its kind. Located in the pedestrian corridor of the Transportation Mall between the T Gates and Concourse A, it features twelve of Zimbabwe's top artists. Though the Art Program chose these sculptures for their intrinsic beauty, the themes explored by the artists also seem universal. The works delve into the importance of family, humanity's relationship with nature and desire to be spiritually connected. The Art Program hopes that these common themes resonate with passengers of all backgrounds.

AT ONE WITH NATUREBy Gladman Zinyeka
1962-2000 Gutu district, Zimbabwe

To create each piece the talented Zimbabwean artists skillfully hand-carved the stone to rough out the initial form without the use of power tools. Next the artists smoothed out select surfaces with sandpaper. Wax was applied to some of the surfaces to create contrasting textures that enhance the work's beauty and emotive qualities.

1962 - 2000 Gutu district, Zimbabwe

One of my favorite sculptures is "Who will raise the child" by Gladman Zinyeka. The mother, father and child in "Who Will Raise the Child" lament the AIDS epidemic that leaves many children without parents. Thematically, Zinyeka's sculptures often meditate on the socio-economic effects of displacement and urbanization, as well as ecological issues.

Picture of tribal village

While they are hundreds of pictures lined up on each wall of the corridor, this village caught my attention as the colors are so intense and the intrinsic and elaborate designs on each of the homes is impressive.

Born 1942 Chiota reserve, Zimbabwe
In "Protecting Spirit," a spiritual presence with human form stands guard over children protecting them from harm. With the eye placed in the figure's hand, Mubayi has created a powerful totemic presence that speaks to the mystery of the spiritual world. Expressing the spirit world and its connectedness to Zimbabwean culture is very important to Mubayi. As with most of Mubayi's work, he used the very hard Springstone for this piece.

Atlanta Bread & Bar

After enjoying the art exhibit, it was time for a beer and some food. This time my choice of spot was the Atlanta Bread and Bar, located next to gate A12, which offers a local experience in a fun and sophisticated atmosphere with delicious food and a full service bar which carries premium and local brands for beer, wine and specialty cocktails. The menu features Atlanta Bread Company fresh soups and made to order sandwiches along with Panini which are served on a variety of daily baked breads. The bar offers an extended menu of appetizers, salads and entrees, including Shrimp and Grits, Steak with Chimichurri Sauce and Chicken Breast with Gouda Grits and Collard Greens. If you ever transiting through concourse A in the morning, they also offer a full service breakfast menu with French toast, omelets, steel cut oatmeal and more!

My flight left at 7:15 PM and had me in Minneapolis at 9:00 PM with only 40 minutes between flights. Fortunately, the flight left from concourse G, which is located next to concourse F, so it was only a 5 minute walk between the arrival gate and the departure gate. Onboard the flight to Fargo, I had a chance to sit next to Cheri Schoenfish, HR Director for the Skype team at Microsoft - and Errol's better half.

Cheri and I on board our flight from MSP to FAR

Upon arriving in Fargo, the scenery changed from endless pictures and sculptures to one of heavy equipment vehicles, small bobcats, and the mother of them all, this all terrain snowmobile - or would this be a SASM (Sport Activity Snowmobile)

Snowmobile at Hector International in Fargo, ND

Errol and Cheri were extremely welcoming and kind to offer a ride from the airport to the Holiday Inn, where I will be staying for the duration of the conference. Being it was late, it was time to go to bed to get some rest after check in.

Until next post!

Mariano Gomez, MVP
Intelligent Partnerships, LLC

Wednesday, October 29, 2014

Microsoft Dynamics GP 2015 Developer's Preview: .NET Framework Interoperability - Part 3

In part 2 of the series, I delivered a brief primer on the service architecture in Microsoft Dynamics GP 2015 and how you are able to consume services natively created with Dexterity. There are two types of services that can be created: services that wrap existing windows and forms functionality, i.e., creating a customer; and services that can wrap around existing sanScript procedures, i.e, retrieving customer information. The truth is, none of that stuff would be possible without the ability to interoperate with the Microsoft .NET Framework.

Today, I'm going to show you some of the .NET interop capabilities built into Dexterity 14.0 and how these can enhance the user experience and your application integration capabilities. The example used in this post is based on my previous article, Building a COM Interop Assembly to use with Microsoft Dexterity, which showed how we had to leverage .NET's ability to expose an assembly via COM interfaces, so we could reference its methods using Dexterity. In that particular example, I built some standard methods to expose the sine, cosine, and tangent trigonometric functions to a Dexterity application. This time around, I will show how to build the same functionality taking full advantage of Dexterity's new .NET interop capabilities.

The user experience will be slightly different this time. In addition to a window that will allow you to calculate any of the trigonometric functions on a specific angle (entered in degrees), we will display a .NET form showing a visual representation of that angle. The .NET form will be dynamically built and displayed from Dexterity using the methods and properties provided by the Form class (System.Windows.Forms) and the visual drawings will be delivered using the classes exposed in the System.Drawing namespace.

1. The first things we must do is incorporate references to the corresponding assemblies for the Forms class and Drawing namespaces. As developer, the first thing you will notice is the enhancements to Dexterity's Library Definition window, which now allows for the selection of a .NET Assembly library type.

Library Definition
Once the type has been selected, you can browse out to the different .NET assemblies loaded on your operating system.

.NET Assemblies
In particular, what I like is the ability to select the .NET Framework assembly that I want to work with directly, as opposed to having to compile my application for a specific Framework version as you normally would do with Visual Studio.

Resource Explorer will now reflect the different .NET namespaces selected for you application.

Resource Explorer

2. Since this article assumes some familiarity with Dexterity, I'm not going to dive into the process of building the form and window, but rather point out that it follows the same layout and properties I used in my previous article.

Form and Window Definition
The only "rarity" here is I added a local field called '(L) GraphicAngleForm' that will serve as a generic reference to the .NET form we will dynamically create. The '(L) Conversion' and '(L) Angle' fields are currency fields and are formatted with two decimals and unsigned (DLR11_U2).

Generic Reference field

3. The code for our '(L) Sine' button will look something like this.

MGB_Trigonometric_Test l_Sine_CHG
// Created by Mariano Gomez, MVP
//  This code is licensed under the Creative Commons 
//  Attribution-NonCommercial-ShareAlike 3.5 Generic license.
using System;
using System.Windows.Forms;
using System.Drawing;

local currency l_angle;
local Form f;

'(L) Prompt' = "The Sin(%1°) value is ";
substitute '(L) Prompt', str('(L) Angle');

// calculate the sine value of the angle after converting it to radians
'(L) Conversion' = Math.Sin(Math.PI * '(L) Angle' / 180.0);

if empty('(L) GraphicAngleForm') then
 f = new Form();
 '(L) GraphicAngleForm' = f;

 f.Text = "Graphical Representation of the Angle entered";
 f.BackColor = Color.White;
 // Set the size of the form
 f.ClientSize = new Size(640, 480);
 // Make the form a fixed size
 f.MaximumSize = f.ClientSize;
 f.MinimumSize = f.ClientSize;
 // event handlers
 f.Paint += PaintAngle of form MGB_Trigonometric_Test;
 f.FormClosed += CloseDrawingForm of form MGB_Trigonometric_Test;
end if;

// show and activate our .NET form
'(L) GraphicAngleForm'.Show();
'(L) GraphicAngleForm'.Activate();

When you really look at the code, the first thing you will notice is the first 3 lines. sanScript now implements the using statement just like C#. sanScript has also been extended to use the implement statement for dynamically referencing an assembly.

using System;
using System.Windows.Forms;
using System.Drawing;

Next we can then calculate the sine of the angle in radians by simply calling the Math.Sin() method in the System namespace (the System namespace is part of the Microsoft Core Library, mscorlib.dll). We also reference the Math.PI constant to perform the conversion of the angle from degrees to radians.

// calculate the sine value of the angle after converting it to radians
'(L) Conversion' = Math.Sin(Math.PI * '(L) Angle' / 180.0);

Once we have the angle converted and displayed in the '(L) Conversion' field, we can proceed to create the form by instantiating the Form class - in reality, this part is no different than what you would normally do for COM classes - and setting some properties for the .NET form we want to display. Once we have set the size of the window, we need to create some event handlers for when the .NET form open and closes. As you can see in the code, Dexterity now implements event handlers through the use of the += operator.

// event handlers
f.Paint += PaintAngle of form MGB_Trigonometric_Test;
f.FormClosed += CloseDrawingForm of form MGB_Trigonometric_Test;

Our event handlers in this case will be the PaintAngle (on .NET form open) and CloseDrawingForm (on .NET form close). The PaintAngle event handler will display the actual graphical representation of the angle, and the CloseDrawingForm event handler will do some cleanup for us. Now, as you may suspect, these event handlers are implemented as procedure scripts to the MGB_Trigonometric_Test form (form procedures). So let's take a look at the PaintAngle form procedure:

// Created by Mariano Gomez, MVP
//  This code is licensed under the Creative Commons 
//  Attribution-NonCommercial-ShareAlike 3.5 Generic license.
using System;
using System.Windows.Forms;
using System.Drawing;

inout System.Object sender;
inout PaintEventArgs e;

local Pen bp, rp;
local Color c;

// Get the color
c = Color.Blue;

// Create the blue pen
bp = new Pen(c, 2);

e.Graphics.DrawLine(bp, 320, 240, 520, 240);
e.Graphics.DrawLine(bp, 320, 240, 320 + Math.Cos('(L) Conversion' of window MGB_Trigonometric_Test) * 200, 240 
 - Math.Sin('(L) Conversion' of window MGB_Trigonometric_Test) * 200);

c = Color.Red;
rp = new Pen(c, 2);

e.Graphics.DrawEllipse(rp, 300, 220, 40, 40);

Again, the mechanics here is not so much the important part, but rather to highlight the clever way in which the event handler parameters are declared for the sender of the event and the event arguments being passed by the sender of the event. For this the Dexterity team chose to implement inout parameters.

Overall the PrintAngle procedure simply draws two lines and a circle. The first line is the base line of the angle and will simply be a horizontal line. The second line actually shows the displacement in reference to the base line to give the actual angle representation. This all looks something like this when the code is executed:

Angle Calculator
Having the ability to leverage .NET capabilities directly from Dexterity has now opened up a new realm of possibilities for Microsoft Dynamics GP business application developers. Applications that were once thought to be out of reach or required complex workarounds are now a thing of the past. Code portability is now much more compact and robust than before. The good part is, Dexterity developers do not need relearn any development patterns and/or be exposed to steep learning curves. All the .NET Framework documentation is available online with tons of sample code to go along.

This article is part of the Microsoft Dynamics GP 2015 Developer's Preview series.

Microsoft Dynamics GP 2015 Developer's Preview: Loading the VHD image - Part 1
Microsoft Dynamics GP 2015 Developer's Preview: Working with Sample URIs - Part 2

Until next post!

Mariano Gomez, MVP
Intelligent Partnerships, LLC