So, Infor have released the Smart Office SDK to plebs^wcustomers like me. After years of me begging, hounding and complaining to anyone that would listen – yes, I know people were dreading meetings with me because of the inevitable question about “When’s the SDK going to be released?”.
Here is a post on the lawsonsmartoffice.com blog (which I’m sure all of you have in the RSS feeds of your browser – if you haven’t, seriously add it. There is a lot to be said about hearing things from real developers working on Smart Office)
I am going to assume that you have read the post above and the installation instructions distributed with the SDK.
This particular post and the posts following it are going to follow a little bit of a different format – they will hopefully be a little more coherent (though that depends entirely on how exciting Gold Rush or the Deep Dive on MS Chanel 9 (check out the C++ and Beyond 2012: Herb Sutter – atomic <> Weapons (C++ 11 Memory Model) video, it is very interesting!) is or whatever the flavour of the month is for me) and give you a view in to how I tend to work through problems. Generally there is a lot of background work or knowledge upon which I build assumptions that are presented here. I will often cut code which serves no purpose what-so-ever except to see if what I believe happens or what I suspect is possible is. Some of this people will have discerned from the code examples that I have posted so far.
We will look at the problem that we are trying to solve, the installation of the SDK and the steps that I take to prove my solution and finally the progress through the solution.
The avid reader I have will have no-doubt seen my lofty goals of purging the evil modifications from my M3 installation. If that reader didn’t get bored enough to skip the odd post then they may will have seen a screenshot of what I call the Vessel Modification. This modification used to have a few profanities in front of its name due to its undesired effects on another modification but we’ll leave it up to you to select an appropriate number and range of words 🙂
The Vessel Mod is really quite interesting for us and what I would consider perfect for this series of blog posts, it is pretty light touch as far as M3 is concerned, the only actual data manipulation that it does to M3 is changing some dates on deliveries. The rest of it does some data retrieval about routes along with a few other things and stores of whole raft of data that someone in our Export Department felt was absolutely imperative to our operation. Some of it was 😉
Our vessel modification consists of three programs and a couple of tables, each capturing different information and relating it back to a customer order. Some of this information is used for another modification (now no longer used – I instead wrote a little wee app which will query the database directly and do the transforms of the data, the removal of that mod alone saves thousands in upgrade costs) which would export data for import in to our Export Document program.
What I am going to do is concentrate on the removal of one of the programs – it records most of the information and interacts with M3. The program is question is ZOI002 M3 CO Connect Vessel and it looks like this
Looks pretty busy, doesn’t it? Essentially this panel links a heap of ‘voyage’ related information to the customer order in a single screen. Routes were deemed too clunky for us to use. The question forming in your mind could be – routes aren’t hard and maybe the process should be redesigned. Yes, and yes, but we have a lot of supporting processes that requires this information and changing it all in one hit is too disruptive. The key part for us is to remove the modifications as quickly as possible with minimum disruption. Redesigning processes and then dealing with the flow on effects will take a lot more time.
So, we will use the SDK to allow us to create a stand-alone M3 program which will replace what we see above. It will use a number of M3 API calls and no-doubt some web-services to allow us to prepopulate the fields and write the fields to M3 itself.
Before we can do anything like that we need to install the SDK. The SDK itself is pretty straight forward to install. Extract it to a directory, set some variables, copy the templates to the Visual Studio template directory (all in the instructions) and you’re pretty much good to go. There was only one thing that I wasn’t 100% certain of and that was the reference to the server URL. To me, the casual coder, I was thinking that it was going to be going to our Smart Office server – but that didn’t quite seem right. And it wasn’t.
If you’re not 100% certain, you can quickly and easily find out the URL by starting up Smart Office itself. Go to the logs and there will be a helpful line like the one highlighted below
https://WLMX02:21006 – this is the URL that needs to be added to the server flag in the registry.
Ok, so let’s assume that you have got the SDK installed – test it with the samples supplied with the SDK and make sure that they compile and that you can run them.
First thing I noticed is the Smart Office login screen.
The version disappears and we see “Developer” instead. A tad optimistic I thought 😉
Log in and now in Navigator I see
The sample adds “Mashup, Other and Sample”
Expand them out and we get
I’m a big Hello World fan, so that is the program that I tested.
(I’ve resized the window)
The next thing to do is prove that the bold statements made my Infor that we can use the debugger is true! We have faith, but I want a baseline – in the samples provided I want to make sure things are working before I invest my time…and because I am a Hello World fan, I’ll try adding a break point in Hello World. By this point, it’s worth noting I have skimmed the actual SDK documentation 🙂
So, I go to my solution in Visual Studio and expand out HelloWorld.
I double click on the “HelloWorldApplication.cs” to take a look. I see a nice “LaunchTask()
And I am going to add a break point
And then I hit run, select “Hello World” . And what do you know…it works!
Note the locals – we can see useful things! Fantastic, I have the power! I BELIEVE! 🙂
Ok, so Hello World is a basic example, but it is important to me – it is opening a new window and populating content. My Vessel Modification is opening a Window and populating content. There is no fluff, we can as a worst case use this as a basis for the Vessel Modification.
Now, the really nice thing (that I might add I missed when I was originally playing around with the code) is this from the source code
We can run HelloWorld from the Navigator start
By setting the URI to sample1 and then entering our ‘Feature’ name, it will run the HelloWorld example without an issue.
- We have proven that we have the SDK installed
- We have proven we can runtime debug
- We have proven we can open a new window and populate the content
- We have proven that we can launch our Feature with a simple URI
In the next post I will create my own project from scratch. The aim will be to prove I can create my own project independently, populate the content and provide some user interaction.