Welcome to BlogEngine.NET 1.6.0

If you see this post it means that BlogEngine.NET 1.6.0 is running and the hard part of creating your own blog is done. There is only a few things left to do.

Write Permissions

To be able to log in to the blog and writing posts, you need to enable write permissions on the App_Data folder. If you’re blog is hosted at a hosting provider, you can either log into your account’s admin page or call the support. You need write permissions on the App_Data folder because all posts, comments, and blog attachments are saved as XML files and placed in the App_Data folder. 

If you wish to use a database to to store your blog data, we still encourage you to enable this write access for an images you may wish to store for your blog posts.  If you are interested in using Microsoft SQL Server, MySQL, VistaDB, or other databases, please see the BlogEngine wiki to get started.


When you've got write permissions to the App_Data folder, you need to change the username and password. Find the sign-in link located either at the bottom or top of the page depending on your current theme and click it. Now enter "admin" in both the username and password fields and click the button. You will now see an admin menu appear. It has a link to the "Users" admin page. From there you can change the username and password.  Passwords are hashed by default so if you lose your password, please see the BlogEngine wiki for information on recovery.

Configuration and Profile

Now that you have your blog secured, take a look through the settings and give your new blog a title.  BlogEngine.NET 1.4 is set up to take full advantage of of many semantic formats and technologies such as FOAF, SIOC and APML. It means that the content stored in your BlogEngine.NET installation will be fully portable and auto-discoverable.  Be sure to fill in your author profile to take better advantage of this.

Themes and Widgets

One last thing to consider is customizing the look of your blog.  We have a few themes available right out of the box including two fully setup to use our new widget framework.  The widget framework allows drop and drag placement on your side bar as well as editing and configuration right in the widget while you are logged in.  Be sure to check out our home page for more theme choices and downloadable widgets to add to your blog.

On the web

You can find BlogEngine.NET on the official website. Here you'll find tutorials, documentation, tips and tricks and much more. The ongoing development of BlogEngine.NET can be followed at CodePlex where the daily builds will be published for anyone to download.

Good luck and happy writing.

The BlogEngine.NET team

Custom XML nodes with eConnect for Dynamics GP to call user stored procedures


Suppose for a moment you wish to transfer credit card authorisation ticket information or other supporting transaction information from a website into your Dynamics GP database.


You can piggyback on your eConnect integration rather than introducing your own integration. The minds behind eConnect thankfully provided some very easy to use extensibility points in the product.

It is really simple. By adding your own XML node to the XML document that is submitted to eConnect it is possible to move your data to the destination Dynamics database. A stored procedure is called there (stored proc name must match the XML node name) and in that stored procedure you can do anything at all -especially if you are into writing CLR code for SQL server.


In the following example we feed an order created by a website, as an XML document (xmlOrder) into a function. Contained within the xml of teh order are the authorisation details for online credit card authorisations. These details need to end up in a custom table in the Dynamics GP company database. The function returns a LINQ XElement that can then be inserted into the eConnect XML that is subsequently submitted to Dynamics GP via the eConnect API. Lets have a look at the VB.NET.

  1. Public Function CreatePaymentTransactionXML(ByVal xmlOrder As XmlDocument) As XElement
  2.         Dim oCustomNode As XElement = _
  3.         <eConnect_InsertCardPayment>
  4.             <SOPNUMBE><%= CurrentSOPNumber %></SOPNUMBE>
  5.             <SOPTYPE><%= 2 %></SOPTYPE>
  6.             <VPSTxID><%= xmlOrder.SelectSingleNode("/order/Credit-Card-Tx-Code").InnerText %></VPSTxID>
  7.             <TxAuthNo><%= xmlOrder.SelectSingleNode("/order/Credit-Card-Auth-No").InnerText %></TxAuthNo>
  8.             <SecurityKey>9999</SecurityKey>
  9.             <VendorTxCode><%= xmlOrder.SelectSingleNode("/order/Credit-Card-Order-No").InnerText %></VendorTxCode>
  10.             <Amount><%= 0 %></Amount>
  11.             <Currency><%= xmlOrder.SelectSingleNode("/order/Currency-Id").InnerText %></Currency>
  12.             <VendorName><%= "mycompanyname" %></VendorName>
  13.         </eConnect_InsertCardPayment>
  14.         Return oCustomNode
  15.     End Function


The example uses the VB.NET literal LINQ xml syntax, it is great for working with these kinds of small XML fragment constructs. The value for each node is pulled out of the sales order XML using XPath statements. Note the example is not yet complete, for example the amount field is tied to a static value of zero but it is functional enough to show the process.

Take notice of the name of the element,“<eConnect_InsertCardPayment>”, this name is also the name of the stored procedure called in the company database. So now a stored procedure needs creating on the company database that will be the end point for this transaction. In this example that stored procedure will insert the data held in the XML to a row in a custom database table.

The custom XML fragment we have just created is inserted into the XML document submitted to eConnect. Add the custom XML node nested inside eConnect transaction type.

The developer can take control of when the procedures are called. The choices are before or after the eConnect procedures have executed. Use the <eConnectProcessInfo> node to do this. The <eConnectProcessInfo> node should always immediately follow the transaction type node. It looks like this:

One of these process info nodes can be added per transaction in the XML document submitted, executing this in VB code looks like this;
  1. Dim oeConnectProcessInfo As New eConnectProcessInfo
  2.         oeConnectProcessInfo.eConnectProcsRunFirst = "TRUE"
  3.         oeConnectType.SOPTransactionType(0).eConnectProcessInfo = oeConnectProcessInfo

Dynamics GP Company Custom Stored Procedure

Each XML element within our custom XML fragment is passed into the stored procedure as a parameter with the same name as shown below (proceeded with @I_v for input variable). You should therefore make certain your elements are named uniquely. Within the stored procedure, as a developer you can achieve what you want. In this case the payment card fulfilment information is merely inserted into a table for later processing or reporting.

CREATE PROCEDURE [dbo].[eConnect_InsertCardPayment]
( @I_vSOPNUMBE varchar(31),
  @I_vSOPTYPE smallint,
  @I_vVPSTxID nvarchar(50),
  @I_vTxAuthNo nvarchar(50),
  @I_vSecurityKey nvarchar(50),
  @I_vVendorTxCode nvarchar(40), 
  @I_vAmount money =0,
  @I_vCurrency char(3),
  @I_vVendorName varchar(20),
  @O_iErrorState int output, /* Return value: 0 = No Errors, Any Errors > 0 */
  @oErrString varchar(255) output /* Return Error Code List */
    @O_oErrorState int,
    @iError int,
    @iStatus smallint,
    @iAddCodeErrState int
/*********************** Initialize locals *****************************************************/
select    @O_iErrorState = 0,
    @oErrString = '',
    @iStatus = 0,
    @iAddCodeErrState = 0
INSERT INTO [my_PaymentCardTransaction]
  return (@O_iErrorState)





But wait there is more

For all the eConnect operations there is a rudimentary “event model” made available via stored procedures. For example inserting a SOP Sales Document will cause the taSOPHdrIvcInsertPre and taSOPHdrIvcInsertPost procedures in the company database to be called before the record is inserted into SOP10100 and after respectively.

You are allowed to open up these procedures and code your own functionality in there. Perhaps you have some third party modifications that don’t natively support eConnect. You could set some database values in these third party tables using the taSOPHdrIvcInsertPost procedure, after the sales order has been inserted. As this is happening after it has been inserted you have all the defaulted values from the sales order document type/classes available to you in the procedure together with the data inserted from the supplied eConnect XML document.

Perhaps you need to validate the sales order information, say for example checking the customer has not supplied a duplicate PO reference to you. This could be done in the taSOPHdrIvcInsertPre, from where you could raise an error should validation fail.

Another useful technique is to combine the custom XML node technique discussed earlier with this event model. Use the custom node to insert the data into a cache table then pull it out and use it in earnest in the post event of the document transaction once all the defaults have been set. One benefit may be to keep the bulk of the sql in one place for clarity and ease of maintenance.

Another idea is to send an email to the sales team from inside the post stored procedure of the transaction, each time a sales order is created by eConnect. Sales staff now get a neat notification that there is a web sales order to process. If you are into writing CLR stuff in SQL you could go almost anywhere with this. Perhaps an alternative to the notification email would be to create a Microsoft Sharepoint task for someone to deal with the order and spin off a workflow to keep the process on track.

Go ahead use your imagination in our implantation, like I have in ours.

Further references

Recommend reading are the MSDN pages on this subject to get the full understanding and further examples of options for eConnectProcessInfo. Full schemas for eConnect are also provided there.

MSDN: eConnectProcessInfo http://msdn.microsoft.com/en-us/library/bb648359.aspx

MSDN Custom XML Nodes: http://msdn.microsoft.com/en-us/library/bb625125.aspx

Gracefully dealing with eConnect errors

If you need to integrate with Microsoft Dynamics GP one of the options you may choose is to use the eConnect product. eConnect is an API that allows you to submit XML documents to Dynamics GP to perform CRUD operations on most of the document types in GP. Using .NET for integrations, if any issues/problems arise from submissions to eConnect,  via eConnect_EntryPoint or eConnect_Requester methods, then these errors are surfaced as eConnect exceptions. The .Message property of this class contains the error text.

The econnectException class returns the message from the eConnect stored procedure that originated the problem. A table of these messages is held in SQL server, DYNAMICS database, table taErrorCode. This table gives an idea of the error conditions you may not have thought possible and lets you be a bit more proactive at handling errors.

ta_ErrorCode To see the contents of this table see this file:

Item does not allow back orders

Lets choose an example problem that you may experience. When submitting a SOP sales order document, normally you want any items that are out of stock to be back ordered. This is easy, set the QtyShrtOpt = 4 in the XML to back order the balance. However if you have a situation where you have a telesales team hammering in orders as well as a website taking orders, even with SQL replication you can occasionally get a scenario where a web order comes in for an item that has been set to disallow web orders and it no longer has enough stock to satisfy the web order. This may be due to latency in updating stock on the website for example. eConnect lets us know with the following exception: “Microsoft.GreatPlains.eConnect.eConnectException: Error Number = 4776”

Gracefully dealing with it

There a few ways I can think of to deal with this, the chosen one is to change the QtyShrtOpt = 6 for the line in question inorder to cancel the qty that can not be allocated from stock. It is wise to then set an order note to let the sales staff who will process the order know about the issue so it can be resolved with the customer, perhaps alternative item offered.

.NET code

A regular expression is used to parse the eConnect exception text. This allows easy detection of what error has occurred and extracts the item number for the order line raising the exception.

  1. Dim ItemNumberList As New List(Of String)
  2. 'Get the item numbers that exhibit this error
  3. For Each CurrentMatch As RegularExpressions.Match In _
  4.     RegularExpressions.Regex.Matches(ErrorText, _
  5.         "(<taSopLineIvcInsert>.*<ITEMNMBR>(.*)</ITEMNMBR>.*</taSopLineIvcInsert>) --->.*Error Number = 4776", _
  6.         RegularExpressions.RegexOptions.Singleline)
  7.     If CurrentMatch.Groups.Count > 1 Then
  8.         'capture 2 has the itemnmbr
  9.         ItemNumberList.Add(CurrentMatch.Groups(2).Value.Trim)
  10.     End If
  11. Next CurrentMatch

Having a list of item numbers with this issue allows us to change the XML of the document being submitted to alter the quantity shortage option flag to cancel the balance (option 6). Promoting LINQ for XML work, load the XML document into a XDocument (LINQ XML Document) class.

  1. Dim salesdoc As XDocument = XDocument.Parse(xmlSalesOrder.OuterXml)

Now use a LINQ query to get all the elements that need the backorder option changing and change it to 6.

  1. For Each CurrentItem In ItemNumberList
  2.     Dim CurrenItemVar As String = CurrentItem
  3.     For Each CurrentElement As XElement In From salesline In salesdoc.Elements.Descendants("taSopLineIvcInsert") _
  4.                     Where salesline.Element("ITEMNMBR").Value.StartsWith(CurrenItemVar) _
  5.                     Select salesline
  6.         CurrentElement.SetElementValue("QtyShrtOpt", "6")
  7.     Next
  8.     salesdoc.Elements.Descendants("taSopHdrIvcInsert")(0) _
  9.       .SetElementValue("NOTETEXT", _
  10.         salesdoc.Elements.Descendants("taSopHdrIvcInsert")(0).Element("NOTETEXT").Value & vbCr & String.Format( _
  11.         "Item: {0} could not be fully ordered due to no back order allowed flag set on item and lack of stock.", CurrenItemVar))
  12. Next
For each item fixed, the XML of the document we are submitting has order notes appended to take account of the fact there is an issue with this item. The sales are already always reading the order notes for customer comments coming through from the website so should catch these notes.

Now the altered XML document is resubmitted to Dynamics GP via eConnnect. If it fails this time there is an issue that we have not programmed for so it needs administrative intervention.

To load the xDocument back into the XMLDocument class for submission to eConnect,

  1. xmlSalesOrder.Load(salesdoc.CreateReader())

Note on security

Beware exposing your ERP system to your website – if the website gets compromised, then so is your business. eConnect allows most of your business data to be altered and queried - this is something to be very careful of. With the implementation I created, the XML document is punched through the firewalls to a custom web service on the GP segment of the network. This web service only lets through the specific eConnect documents we want to allow through and only those that meet specific criteria to limit the attack potential.


By adding to this example, common errors your eConnect integration encounters could be eliminated so IT staff are prevented from spending time supporting disruptive day to day integration issues. Thus these problem cases are handed back to the process owner, be that; buyers, warehouse, or sales staff.

Windows snipping tool

Type “Snipping” in to Windows 7 start bar


Select snipping tool from the list

Snipping Start Menu View

You can now make window screen grabs or freehand screen grabs using this tool.

Snipping Tool View

Taking a screenshot of a drop down menu with the snipping tool

However you get stuck when you want to take a screen shot of a menu item like a right click menu or drop down program menu. In this case the snipping tool can be activated by pressing [CTRL] & [Prnt Scrn] together. This then switches on the screen grab mode of the snipping tool and you can snip away! Obviously you have to launch the Snipping Tool before it will let you active the screen grab with this key shortcut.

Windows 7 users (even XP if you install it from download at Microsoft)

You should look at the Problem Steps Recorder (type “psr” into your start menu). This tool will take a continuous run of screen grabs as you execute a process and at the end you may save them to a zip file. Ideal for use in documentation for a process in an application or computer.