Thursday, May 28, 2015

Binding Entries Back From GridView to Dataset

The Manage 2000 DAC architecture relies on strongly typed datasets to manage the movement of business object data between UniData and ASP.NET webcontrols.  The table adapters generated for the datasets handle the binding of data from dataset to the webcontrols very nicely.  There are not, however, any generated methods for Update, Change or Delete operations.

It is possible without an awful lot of code to handle the gridview row events and utilizing the strongly typed dataset methods move the data back into the dataset from the UI.

Here is the SoWebShipments page converted to use GridView controls in place of UltraWebGrid controls:


To move the data back into the dataset we just need to handle the RowUpdating event to move the data and then handle the RowUpdated event to tell the grid the we handled the problem with the missing Update Method on our table adapter. In order to support deleting rows we do the same exercise in the RowDeleted and RowDeleting events handlers.



Monday, April 6, 2015

"And the beat goes on. And the beat goes on."

Yes Ma, I'm still here tinkerin with M2k.

One of the major tasks we are undertaking in developing the next release is to go through all the web pages that have grids on them and do a proper house cleaning.  Its like when you buy new appliances for the kitchen, you're gonna want scrub a little bit behind where the fridge and stove have been settled for the last decade or two. And you are probably going to find things that you wish you hadn't.  But a thorough cleaning every 10 or 20 years brings you closer to God.

So I have been becoming one with the Microsoft GridView component. To begin with I thought it was simple and a bit clumsy with the whole Templated Column approach for links and whatnot.  And there are times when the object model gets annoying as you try to get after some behavior programmatically.  But I have found it to be remarkably pliable.

One of the astonishing things I found was the ability to databind in the aspx file to a group of children of the current row.  Manage 2000 has always used strongly typed datasets in order to get nice design time support in Visual Studio.  But this also means that strongly typed datarows know how to get their children.

The unfortunate part is some rather scary looking casting in order to access the strongly typed datasets properties and methods.  And also the ever annoying IsxxxNull checks that are a must for optional fields.

But the amazing part is adding a templated column in the aspx and having a child set of sub-values or sub-sub-values unfurl before the user:


So the Planned Components are being bound directly in the aspx file from databinding references:

DataSource="<%# DirectCast(DirectCast(Container.DataItem, System.Data.DataRowView).Row, ROISystems.Components.dstItemOrderListing.MFGORDERRES_Order_DetailRow).GetMFGORDERRES_Order_ComponentsRows %>"

Tuesday, September 2, 2014

What I Did On My Summer Vacation

Release 8.0 is taking root in the field and the development group is starting to look forward toward 8.1.  In the next couple of weeks Allan will be setting up the Unidata accounts for 8.1 development and I will setup the build machine and devweb machine for the ASP.NET side of 8.1.

I have already started on the work of replacing Infragistics controls in the Portals with combinations of standard Microsoft controls and jQuery and jQuery Mobile clientside effects in my lab environment. The "System.Web.DataVisualization.Charting.Chart" class introduced as an add-on download in 2008 is now a standard part of Visual Studio 2012.  It is based on the Dundas chart control and provides a very nice alternative to the Infragistics UltraWebChart which Infragistics eliminated from their ASP.NET suite in 2012.

The UltraWebGrid which Infragistics also dropped will be replaced with standard Microsoft GridView and DetailView controls. It takes a bit more work but hiearchical GridView/DetailView compositions can effectively replace what Manage 2000 was doing with the UltraWebGrid.

It also took a little trial and error to find a nice replacement for the IG Update Panels; one that would work nicely in both desktop and touch enhanced tablet or phone mode.  But now that jQuery is part of the Manage 2000 javascript foundation a simple slow jQuery toggle on the content container div provides a pleasant collapse/expansion in both modes.  There will still be a little more work to combine in a partial postback or async JSON update where speed and backround paging are desired.

So I feel a little bit like a race horse chomping at the bit in the 8.1 starting blocks.

Also on the dockit for next month is the Novo User Group Meeting October 5 - 10, 2014 here in Minneapolis. I am putting together sessions on integration of Manage 2000 with Microsoft Office products, the evolving Manage 2000 javascript foundations, and touch enhancement mark-up (how our web functions are using jQuery Mobile).  Hope to see you there.

Wednesday, March 26, 2014

Getting Ready For Insights 2014

Once again I am gathering a few technical stories and tweaking "official" powerpoint templates and testing out demonstration bits of Manage 2000 web technology to take to Las Vegas for the EPICOR Insights user group meeting.

It's a bit earlier this year starting April 27 and running through the 30th.  And we have graduated from Caesar's to Mandalay Bay.

I will give my annual talk about Manage 2000 Web Technology, where we have gotten to with the 8.0 release of Manage 2000 and some of my thoughts looking forward to development thrusts we may pursue for the 8.1 release.

I am also doing a session on Programming Manage 2000 Access Into EXCEL 2010.  My last blog post was based on research for this session.

Other sessions of mine will explore the BTO Framework, roiToolServices, and some of the new REST javascript services running in 7.3 and 8.0.

Hope to see some of you there.

Wednesday, February 5, 2014

Programming Manage 2000 Access Into Excel

I was looking for a way to demonstrate Manage 2000 Data Access Components and web services outside of Manage 2000 web functions. I found VSTO, that is Visual Studio Tools for Office.

VSTO provides templates for creating Office projects like Excel WorkBooks and custom Ribbon Tabs.

You get to write .Net code to add behavior to the Excel workbook. It starts getting interesting to me when you add a web service reference to /MT/ERPBusinessObjectService/ERPBusinessObjectService.asmx.

With this combination you can create Manage 2000 awareness in Excel workbooks. This might take the form of item validation:


Or maybe Cross Referencing:



Or even reading and writing business objects:


You do have to be mindful of release levels.  Visual Studio 2008 cannot work on Office 2010 projects. Visual Studio 2012 has trouble with ASP.NET 4.5 assemblies unless you download the latest AddIn that makes it compatible with both Office 2010 and Office 2013.



Tuesday, January 21, 2014

Cross Origin Resource Sharing

In release 7.3 we added a REST service endpoint named /MT/JSONServices to provide all sorts of asynchronous services to javascript functions running in browsers. These services can validate items, return TM tables, and in the latest releases even run UniBasic subroutines.

One BIG limitation with RESTful services has been the "Same Origin Policy" which was put in place for legitmate security concerns, but prevents sharing these really nice dynamic services across domains. How nice would it be to use Manage 2000 REST services to validate items in your third-party or self-rolled shopping cart application or CRM application or ...?

The W3C answer to this constraint is known as CORS (Cross Origin Resource Sharing) and has been supported in Chrome and Firefox for many releases, but has just recently gained full support in IE 10+.

You can implement CORS support through IIS custom headers, but I thought it would be nice to have a list of CORS approved sites in WEB.CONSTANTS where it can be more easily maintained by Manage 2000 account.  So Manage 2000 release 8.0 has a new screen in WEB.CONSTANTS for just this purpose and the /MT/JSONServices project has been updated to respond to CORS requests based on this list.




You will find example code on the JSONServicesTester page which you can run from the Development menu in the 8.0 release:


Monday, January 6, 2014

Manage 2000 Web Update from Frostbite Falls MN

Yes, it is MINUS -19F degrees today in balmy Minneapolis, with an expected HIGH of MINUS -15F degrees. Our EVPN authentication system decided it did not like my password this morning so I have some time to catch you up on Manage 2000 8.0 web development.

The 8.0 Beta is in progress and we have received and cashed-in our first treasure.  Beta startup drifted into the holidays and end of year, but I expect to be working on many more bug clean-up items over the next month or two in preparration for the GA cut.

In the mean time I am filling in my time with work on ASP.NET Health Monitoring.

The ASP.NET Health Monitoring system was developed by Microsoft and built into the ASP.NET 2.0 framework. By default it just pushes unhandled exceptions into the web servers event log.  But with a few web.config modifications you can coax it into sending emails to an administration email address with exceptions, heartbeat status reports, and custom health monitoring events.

I am putting together some doc on it for the WEB.ADMIN.COURSE and the SYS.WEB.HOWTOs menu. And I will leave my web.config settings from testing commented out in the release so that administrators can just uncomment sections, replace a couple of parameters, and experiement with this nice monitoring system.

There is another popular monitor for unhandled exceptions named ELMAH.  I played with this guy a little bit too. He can be added to existing web sites easily and does a nice job of presenting unhandled exceptions to the administrator through RSS feeds or a web interface.  But ELMAH does not seem to offer any custom extensibility options to instrument the Manage 2000 web site.

So I am sticking with ASP.NET Health Monidoring and adding a custom Manage 2000 Health Monitoring event in release 8.0 that can poll the Unidata box and let the administrator know if Redback goes down.