Windows 8 Microsoft VPN Error 850


Recently I attempted to connect to a Windows VPN with windows 8 and received an error “Error 850: The Extensible Authentication Protocol type required for authentication of the remote access connection is not installed on your computer.”

I had set up the VPN the same way it was setup on Windows 7 but could not get it working.  For me, the error was quite misleading and an internet search on the error led me to believe I needed a certificate.  It turns out, I just needed to change my settings and allow the proper protocols.

To do this, go into the control panel under Network and Internet and choose Network and Sharing Center.  In the Network and Sharing Center, click change adapter settings.  You will see something similar to the screen below.

image

 

Right click the connection you setup and choose properties.  From the properties window, click the Security tab.

image

Your windows should look something like above.  In my scenario, Use Extensible Authentication Protocol was selected and I needed to change that to Allow these protocols and select the CHAP.

 

That worked for me.  Hopefully you find that helpful.

author: T | Posted On Wednesday, July 9, 2014 3:07 PM | Comments (0)

Setting a WPF Image programmatically


Here is one way to mapping images using code behind in WPF

so.ImgMap.Source = new BitmapImage(new Uri(String.Format("../{0}/{1}",ImagePath,ImageName),UriKind.Relative));
In this example, Images must have their Build Action Property set to Resource or Content and not Embedded Resource in Visual Studio.
image
 
There are many options for the Build Action Property and the help file explains them very well.  For this example, the two that matter are Embedded Resource which is the default and Content.

Content - The file is not compiled, but is included in the Content output group. For example, this setting is the default value for an .htm or other kind of Web file or in our case where we want to include the file as a default but the user can still reach it if they know how.

Embedded Resource - This file is embedded in the main project build output as a DLL or executable. It is typically used for resource files.

author: T | Posted On Monday, June 30, 2014 12:24 AM | Comments (0)

Great resources for educators


current as of 5/20/14.  In no particular order. 

Virtual Academy Free Microsoft Training Delivered by Experts
Dream Spark Library of software and resources for students
Azure in Education Microsoft provides grants for educators wanting to use Azure in their curricula.
Woot Studio Tower Game Starter Kit and Platformer Starter Kit
Nokia DVLUP Nokia DVLUP.  Have fun, earn rewards, build new ideas.
Faculty Connection Faculty Resources and community
Microsoft IT Academy academic institutions and their educators, students and staff get digital curriculum and certifications for fundamental technology skills
Biz Spark not really for the educators but in continuing education can be  of interest to the students
   
   
   
   
   
   
   
   
   
   
   
   

author: T | Posted On Tuesday, May 20, 2014 10:51 AM | Comments (0)

WPF - Create a custom toggle control with touch and binding support with Blend for Visual Studio 2013


Create a new wpf user control with the following steps •1. Import Photoshop file to get look and feel •2. Create control and template using standard toggle button •3. Add touch support •4. Add dependency properties for binding support

author: T | Posted On Saturday, December 7, 2013 10:31 PM | Comments (1)

MVP Summit November 2013


This years MVP Summit II was fantastic.  It was great to see people that I don’t get to chat with often enough, hear about things in the pipeline, and learn about things other people are doing.  While a lot of it is under NDA, there were also many parts that are not under NDA that I really enjoyed and wanted to share.

Lucian Wischik  held a great session on Async Best Practices – For Using Async, and for creating Async APIs.  This is a must for anyone who has not seen Lucian talk about Async… even if you think you know it well.  His blog post can be found here (and please stop using async void).

I had to go download the bits for Prism for WinRT after hearing about it from Blaine Wastell and Francis Cheung.  You can check it out here.

It was great to be one of the first to hear about the Patterns and Practices Open Development Model for the app blocks that make up the Microsoft Enterprise Library.  To learn more, follow this link .

Look for me to release some future blog posts on Unity. 

On the education side of Microsoft, I was introduced or re-introduced to https://www.facultyresourcecenter.com (I keep wobbling back and forth on if I have been there before or not).  It is a fantastic tool for professors to both find and post content.

It was a great time and I really think Microsoft is pushing in the right direction. Now I have to get back to work.

author: T | Posted On Sunday, November 24, 2013 1:53 AM | Comments (0)

Dynamics NAV 2013 consuming a rest web service using DotNet DataTypes


In this example we will use Melissa Data to validate addresses (http://www.melissadata.com/) but you can modify the example to use any service.  For this example, the goal is to use the Melissa data rest based web service to verify a customer address in NAV and get the results back.  What is done with those results will be up to the developer. 

There is an assumption that you know enough about C/AL code and different object types to know where you are trying to put the code.

First thing to do is to setup the variables that will be used. 

Name DataType Subtype
xml DotNet System.Xml.XmlDocument.'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
xmlnodelist DotNet System.Xml.XmlNodeList.'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
i Integer  
xmlnode DotNet System.Xml.XmlNode.'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
results Text  
j Integer  

DotNet Datatypes are relatively new.  To pick the ones that you want to use, see the instructions below.  These instructions show what it looks like after all options have been chosen.  As you walk through it the first time, many of the fields will be blank until the previous option has been clicked.

Here is how you would setup the first item in our variable list above.  This is the variable we called xml and the subtype is shown as System.Xml.XmlDocument.'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.  When you break that up, what we are looking for is the System.XML 2.0.0.0 Assembly and the XmlDocument Type within that assembly.

image

  1. 1.  From the C/AL locals or globals screen, add a new item.  Give it a variable name and choose DotNet under DataType.  At this point, the Subtype will be blank.  Click the ellipse in the Subtype feild to assign the appropriate .net data type (the ellipse is shown under the 1 in the image above).
  2. 2.  The .NET Type List will appear.  Click the up arrow in the Assembly field.
  3. 3.  This will open the Assembly List window.  Chose the .NET tab.
  4. 4.  In our case, find System.Xml.  Here, we chose to use the 2.0.0.0 version. Click OK.  Note: You are welcome to experiment with the 4.0.0.0 version or any other .NET types that may do what you want.
  5. 5.  After choosing OK on the Assembly that you want, the list of Types for that Assembly will appear in the  .NET Type List.  Find the System.Xml.XmlDocument and click OK.

 

Follow the same steps for xmlnodelist.  In that case, it shows System.Xml.XmlNodeList.'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' so you will want the System.XML Assembly 2.0.0.0 then the XmlNodeList Type.  Use the same type for another variable called xmlnode.

First setup the XML Document and call Melisa data with the correct URL to get the results.


  xml := xml.XmlDocument();
  Customer.GET("Customer No.");
  xml.Load('https://addresscheck.melissadata.net/v2/REST/Service.svc/doAddressCheck?id='+MelisaDataCustomerId+'&opt=true&comp=&u=&a1='+Customer.Address+'&a2='+Customer."Address 2"+'&ste=&pmb=&city='+Customer.City+'&state='
    +Customer.County+'&zip='+Customer."Post Code"+'&p4=&ctry=&last=');

After that, the idea is to read the xml and parse it to get the values out.


xmlnodelist := xml.SelectNodes('//*');
IF( xmlnodelist.ToString()<>'') THEN
BEGIN
j:=xmlnodelist.Count; 

FOR i := 0 TO xmlnodelist.Count - 1 DO
BEGIN
  xmlnode := xmlnodelist.Item(i);
  CASE xmlnode.Name OF
    'Value': [Field or variable to store value]:= xmlnode.FirstChild.InnerText;
  // add more cases
  End
End

 

The basic code for this example looks like this:



 xml := xml.XmlDocument();
  Customer.GET("Customer No.");
  xml.Load('https://addresscheck.melissadata.net/v2/REST/Service.svc/doAddressCheck?id='+MelisaDataCustomerId+'&opt=true&comp=&u=&a1='+Customer.Address+'&a2='+Customer."Address 2"+'&ste=&pmb=&city='+Customer.City+'&state='
    +Customer.County+'&zip='+Customer."Post Code"+'&p4=&ctry=&last=');

xmlnodelist := xml.SelectNodes('//*');
IF( xmlnodelist.ToString()<>'') THEN
BEGIN
j:=xmlnodelist.Count; 

FOR i := 0 TO xmlnodelist.Count - 1 DO
BEGIN
 
  xmlnode := xmlnodelist.Item(i);
  CASE xmlnode.Name OF
    'Urbanization': "Urbanization Code":= xmlnode.FirstChild.InnerText;
    'Address1': "Address 1":= xmlnode.InnerText;
    'Address2': "Address 2":= xmlnode.InnerText;
    'Suite': IF xmlnode.ParentNode.Name = 'Address' THEN "Suite Name":= xmlnode.InnerText;
    'PrivateMailBox': "PMB Name":= xmlnode.InnerText;
    'City': 
      BEGIN
        City:= xmlnode.FirstChild.InnerText;
      END;
    'State':
      BEGIN
        State:=xmlnode.LastChild.InnerText;
      END;
    'Zip':
      IF xmlnode.ParentNode.Name = 'Address' THEN
           Zip:=xmlnode.InnerText;
    'Plus4': "Plus 4":=  xmlnode.InnerText;
    'Country':
      BEGIN
        Country:= xmlnode.FirstChild.InnerText;
        //MESSAGE('Set country name to: ' + xmlnode.LastChild.InnerText);
      END;
    'CarrierRoute': "Carrier Route":= xmlnode.InnerText;
    'DeliveryPointCode': "Delivery Point Code":= xmlnode.InnerText;
    'DeliveryPointCheckDigit': "Delivery Point Code Digit":= xmlnode.InnerText;
    'CongressionalDistrict': "Congressional District":= xmlnode.InnerText;
    'AddressKey':"Address Key":= xmlnode.InnerText;
    'Results':
      BEGIN
        IF xmlnode.ParentNode.Name = 'Record' THEN
          BEGIN
            results := '';
            IF STRPOS(xmlnode.InnerText, 'AE01') > 0 THEN results := results + 'Zip Code Error; ';
            IF STRPOS(xmlnode.InnerText, 'AE02') > 0 THEN results := results + 'Unknown Street; ';
            IF STRPOS(xmlnode.InnerText, 'AE03') > 0 THEN results := results + 'Component Error; ';
            IF STRPOS(xmlnode.InnerText, 'AE04') > 0 THEN results := results + 'Non-Deliverable Address; ';
            IF STRPOS(xmlnode.InnerText, 'AE05') > 0 THEN results := results + 'Address Matched to Multiple Records; ';
            IF STRPOS(xmlnode.InnerText, 'AE06') > 0 THEN results := results + 'Address Matched to Early Warning System; ';
            IF STRPOS(xmlnode.InnerText, 'AE07') > 0 THEN results := results + 'Empty Address Input; ';
            IF STRPOS(xmlnode.InnerText, 'AE08') > 0 THEN results := results + 'Suite Range Error; ';
            IF STRPOS(xmlnode.InnerText, 'AE09') > 0 THEN results := results + 'Suite Range Missing; ';
            IF STRPOS(xmlnode.InnerText, 'AE10') > 0 THEN results := results + 'Primary Range Error; ';
            IF STRPOS(xmlnode.InnerText, 'AE11') > 0 THEN results := results + 'Primary Range Missing; ';
            IF STRPOS(xmlnode.InnerText, 'AE12') > 0 THEN results := results + 'Box Number Error from PO Box or RR; ';
            IF STRPOS(xmlnode.InnerText, 'AE13') > 0 THEN results := results + 'Box Number Missing from PO Box or RR; ';
            IF STRPOS(xmlnode.InnerText, 'AE14') > 0 THEN results := results + 'Input Address Matched to CMRA but secondary number not present; '; 

            IF STRPOS(xmlnode.InnerText, 'AS01') > 0 THEN results := results + 'Address matched USPS; ';
            IF STRPOS(xmlnode.InnerText, 'AS02') > 0 THEN results := results + 'Address matched to non-postal database; ';
            IF STRPOS(xmlnode.InnerText, 'AS09') > 0 THEN results := results + 'Foreign Postal Code Detected; ';
            IF STRPOS(xmlnode.InnerText, 'AS11') > 0 THEN results := results + 'Address matched to CMRA; ';
            IF STRPOS(xmlnode.InnerText, 'AS12') > 0 THEN results := results + 'Address deliverable by non-USPS; ';
            IF STRPOS(xmlnode.InnerText, 'AS13') > 0 THEN results := results + 'Address Updated By LACS; ';
            IF STRPOS(xmlnode.InnerText, 'AS14') > 0 THEN results := results + 'Suite Appended by Suite Link; ';
            IF STRPOS(xmlnode.InnerText, 'AS15') > 0 THEN results := results + 'Suite Appended by Suite Finder; '; 

            IF STRPOS(xmlnode.InnerText, 'SE01') > 0 THEN results := results + 'Web Service Internal Error; ';
            IF STRPOS(xmlnode.InnerText, 'GE01') > 0 THEN results := results + 'Empty XML Request Structure; ';
            IF STRPOS(xmlnode.InnerText, 'GE02') > 0 THEN results := results + 'Empty XML Request Record Structure; ';
            IF STRPOS(xmlnode.InnerText, 'GE03') > 0 THEN results := results + 'Counted records send more than number of records allowed per request; ';
            IF STRPOS(xmlnode.InnerText, 'GE04') > 0 THEN results := results + 'MelissaData Customer Number is Invalid; ';
            IF STRPOS(xmlnode.InnerText, 'GE05') > 0 THEN results := results + 'MelissaData Customer Number is Invalid; ';
            IF STRPOS(xmlnode.InnerText, 'GE06') > 0 THEN results := results + 'MelissaData Customer ID is Disabed; ';
            IF STRPOS(xmlnode.InnerText, 'GE07') > 0 THEN results := results + 'XML Request invalid; '; 

            IF STRPOS(xmlnode.InnerText, 'AC01') > 0 THEN results := results + 'Unknown (AC01); ';
            IF STRPOS(xmlnode.InnerText, 'AC02') > 0 THEN results := results + 'Unknown (AC02); ';
            IF STRPOS(xmlnode.InnerText, 'AC03') > 0 THEN results := results + 'Unknown (AC03); ';
            IF STRPOS(xmlnode.InnerText, 'AC04') > 0 THEN results := results + 'Unknown (AC04); ';
            IF STRPOS(xmlnode.InnerText, 'AC05') > 0 THEN results := results + 'Unknown (AC05); ';
            IF STRPOS(xmlnode.InnerText, 'AC06') > 0 THEN results := results + 'Unknown (AC06); ';
            IF STRPOS(xmlnode.InnerText, 'AC07') > 0 THEN results := results + 'Unknown (AC07); ';
            IF STRPOS(xmlnode.InnerText, 'AC08') > 0 THEN results := results + 'Unknown (AC08); ';
            IF STRPOS(xmlnode.InnerText, 'AC09') > 0 THEN results := results + 'Unknown (AC09); ';
            IF STRPOS(xmlnode.InnerText, 'AC10') > 0 THEN results := results + 'Unknown (AC10); ';
            IF STRPOS(xmlnode.InnerText, 'AC11') > 0 THEN results := results + 'Unknown (AC11); '; 

            IF xmlnode.InnerText = 'AS01,AS12' THEN results := 'Input Address Matched to DPV; '; 

             "Result Codes" :=  xmlnode.InnerText;
             "Result Text" := FORMAT( results,250);
          END
      END
  END;
END;

 

The MelisaDataCustomerId is just a key that Melisa data assigns to allow use of the service.  The code gets more complicated because we have to parse multiple results but that is not the point of this post and may come in a later post.

author: T | Posted On Sunday, September 22, 2013 11:12 PM | Comments (0)

Styling Dynamics NAV 2013 Page Values To Bring Attention To Them


 

When editing pages in NAV 2013, you can set styles to draw attention to values.  This is done by using the property value for style on a field and setting it to a pre-defined value.  Note:  The styling does not apply in the Web Client.

Style shown in the property list:

Style shown in the property list

 

Here is examples of how values will appear with the style applied on the page from NAV 2013 base installed on Windows 8.

Style Result Example
Standard no style image
StandardAccent Blue image
Strong Bold image
StrongAccent Bold Blue image
Attention Italic  Red image
AttentionAccent Italic Blue image
Favorable Green image
Unfavorable Bold Italic Red image
Ambiguous Yellow image
Subordinate Grey image
     

author: T | Posted On Sunday, September 22, 2013 8:49 PM | Comments (0)

Reporting with Dynamics NAV 2013


 

This is a basic description of report writing for Dynamics NAV 2013.  It does not get into any advanced functions or the ability to use C/AL code. 

Use the NAV CSIDE environment to either choose a report or click design or new report

For reporting, everything starts at the Report Dataset Designer:

image

The important key areas to understand are the Label Designer, Request Options Page Designer, and the Visual Studio 2010 Report Designer. Knowing these base areas will allow you to explore current reports to learn how base functions were done and use your favorite NAV site or search engine to learn more.

From the dataset designer, click view and then request page to bring up the request page. The request page is used to show user options for filtering or making decisions before the report is run.

image

Also from the dataset designer, you can press view labels to open the Label designer. The advantage to using the label designer instead of putting plain text in your report on labels is multi language support or the ability to dynamically change labels in code behind.

image

Everything up to now has been the backend setup for the report.  The UI is controlled in Visual Studio 2010.  From the Dataset Designer, choose view and Layout.  If properly setup, visual studio will open.

clip_image008

Totals are controlled in the footers of groups.

clip_image010

Using understandable names to every control is essential to trouble shooting later and succession planning. Do not be afraid to use descriptive words and avoid abbreviating.

Right click on the upper right hand corner of the table that was just added and choose properties.  This will allow you to set the dataset to the table for displaying.

clip_image012

clip_image014

clip_image016

Expressions are available for most properties and can be used to set values. A couple of useful example are to use expressions to change colors to show extreme values or show and hide a row based on a value in it. 

clip_image018

author: T | Posted On Tuesday, September 17, 2013 11:27 AM | Comments (0)

Dynamics NAV 2013 Debugger


Dynamics NAV 2013 comes with a completely redesigned development experience. One of the nicest new features is the innovative debugger. When I was looking for information that covered the new debugger, I found a lot of small articles that simply said it was more powerful and would debug any c/AL code. I wanted to understand it more, so I installed it to play with. I understand that not everyone has that luxury so I wanted to write a more in depth article to help you decide if it is truly worth looking at. Even if you are not a developer, this feature could prove valuable to you and should be considered when comparing new systems or when taking into account an upgrade proposition. The features in this debugger will drastically cut trouble shooting time and help to identify issues quickly.

The first indication of the power of the redesigned debugger is that it allows you to choose what session you would like to debug. This opens up the ability to debug any C-Side code anywhere in the application. This includes pages, reports, and xml ports and gives you the ability to debug objects running under any user (including the application server). If that doesn’t excite you enough, check out the walk through of this fantastic tool and see what it can do.

Open Microsoft Dynamics NAV 2013 Development Environment

Open a database by using the File -> Database -> Open option

From there click on Tools -> Debugger -> Debug Session or click Shift+Cntl+F11

This will bring up the Session List window shown below.

Session

clip_image002

All sessions attached to the chosen database are shown in the session list [Session.1]. If you choose a session and click the Debug option [Session.2] or press Cntrl+Shift+S a debug session window will come up waiting for an action from that session. Without even starting to debug a session, you can get critical information about the sessions that are attached to a db such as:

· the user id attached to the session

· what type of client they are attaching with

· what server they are coming from [Session 4]

· if they are currently being Debugged [Session 5]

· if they have been Debugged [Session 6] while this session of the Debugger has been open

· if SQL Tracing is enabled [Session 8] (SQL Tracing is covered at the end of this post).

Debugger

clip_image004

If there was already a break point set, the user could not just move through the code until they hit the break point.

The options shown in [Debugger 2] are to step into, step over, and step out all pertain to functions that you are currently in when sitting on a line. They are pretty standard with any debugger and not new to the debugger in 2013.

The same goes for the options in [Debugger 3]. Continue starts the code and continues to the next break. Break will stop the code at the next statement and is good to turn on when you are sitting in a position on a page and just want to know clip_image006the first thing to run when you start and action. Stop, stops the entire debugging session.

This brings us to the options in [Debugger 4]. Toggle is common and will toggle a break point when you are sitting on that line in the code window. This is also accomplished with F9. Set/Clear Condition is a bit more exciting. When you are on a break point and click it you will see the window to the right. It allows you to put in an expression to be evaluated and decide if the code breaks there or not. If a break point has a condition set, it will display a plus inside the circle clip_image008

clip_image010

In addition to any break points that are set, Break Rules [third option in Debugger.4] are additional options for when to break in code. The rules are Break On Error, Break On Record Changes, and there is a checkbox to indicate if you want to debug codeunit 1 or not.

Skipping codeunit 1 is important when walking through code. It prevents you from having to run through all the system and change log checks so you can simply step through the code block you are concerned with.

The next option in [Debugger 4] does exactly what it says, it disables all the current breakpoints you have set. An easy button when you want to continue to the end but you do want all the code to execute so you don’t want to cancel your debugging session.

clip_image012

The final option in the [Debugger 4] set of options is the ability to show a full list of all breakpoints currently set. This is done with the Break point list (Shown to the right). The options are self-explanatory and all do exactly what they say. This is a very nice feature to be able to manage all of your break points and enable/disable different ones with each run through the code. Just the ability to see them all in one single list makes debugging much more transparent and straight forward. No longer do you need to run the code to a break point then disable it when you do not think you need it for this run. In addition, if you do happen to know the object and line number you wish to set a breakpoint on, you can also add a new break point within this list.

So that takes care of our debugging options when we know the session we want to debug but what happens when we need to debug a web service call into NAV or a NAS session? Well, that is where [Session 3] option comes into play. It says debug next and it is used to debug the next session that comes on line. So if you want to debug a Web Service call, you will need to find a time when you can isolate the calls in and then turn this on, start your web service call and it should be the session caught. Same for NAS or any application that uses session start, just isolate the db, then start the service or process and capture the next session that appears.

This brings us to the last option we will discuss in this article. Full SQL Trace [Session 7 and 8]. SQL profiler is something I have used a lot of since I started with NAV. Generally to understand permissions but occasionally, it has been instrumental in solving issues. However useful, it has also always been a little frustrating because of the amount of obfuscated code. When used with Profiler, the Enable Full SQL Trace button at the top coupled with the corresponding check mark on each session you want to trace. There is a great article on how to do this on the Dynamics NAV team blog here http://blogs.msdn.com/b/nav/archive/2012/09/18/example-of-how-to-use-sql-tracing-feature-to-profile-al-code.aspx

author: T | Posted On Sunday, April 21, 2013 8:15 PM | Comments (1)

Inaugural Cowtown Code Camp is a huge success


With 25 development sessions over the course of the day, participants joined together to learn from leading industry experts and share professional discourse in a number of areas. With session tracks on Architecture, Game, Mobile, Web and Windows 8, the Cowtown Code Camp sessions covered a wide range of topics that are pertinent in today’s technical world. From talks dedicated to leveraging new API’s for easier development, to creating next generation mobile apps, Cowtown Code Camp offered something for everyone. Microsoft also hosted a Lounge area, where they answered developer questions about the Microsoft Stack and the Window’s Store, and demonstrated development for Windows 8.

Read more….

author: T | Posted On Friday, April 19, 2013 12:14 PM | Comments (0)