Smart Office SDK – First Project Part 1 – Testing the Installation

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)

http://lawsonsmartoffice.com/2013/02/04/getting-started-with-the-smart-office-sdk/

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.

In Summary

  • 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

Coming Up

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.

This entry was posted in Development, M3 / MoveX, SDK and tagged . Bookmark the permalink.

11 Responses to Smart Office SDK – First Project Part 1 – Testing the Installation

  1. karinpb says:

    Nice, it’s fun to read posts like this. If you develop an application like this it can be a good idea to have another exe project that will include you “MainxxxPanel” without Smart Office in the same solution. Then you just switch startup project and it gives you less start up time. So this is nice while you create the UI but as soon as you start using MIAccess you need to be in Smart Office. What version of Smart Office are you targeting?

    • potatoit says:

      Thanks Karin, it’s fun using the SDK 🙂

      And thank you for the tip – I’ll give it a shot. The version of Smart Office I’m targeting is 10.0.5 – I upgraded the last of my environments to it last night.

      From what I have read so far, I gather that if I want to modify the behaviour of an existing M3 program I need to use it in conjunction with a Mashup?

      • karinpb says:

        If you need to modify an existing M3 program the only thing you can do is to use Jscript. With the SDK you can use Jscript and call your class instead of doing all the coding directly in the Jscript which means that you can debug as the call reaches your code and write much better production code. But there is only so much you can do with JScript. With M3 you can’t change any real logic in the program on the client – in that case you need a modification. But for certain validations, adding a new field or other stuff you can use Jscript.

        We can’t really say that you can change that much in the M3 programs so that is why you should look into Mashups and do your own mashup control becuase then you can reuse M3 programs and add your own controls with your content next to standard M3 functionality (in the Mashup). In your case when you write this application you should consider writing it so that it can be hosted in a window and in a Mashup control as well.

        This is probably why we start to talk about Mashups, depending on your technical background it is hard to grasp what you can or can’t (or shouldn’t) do in Jscript.

        Note that Jscript does not run on detail panels in Mashups.

      • potatoit says:

        Thanks for the clarifications – I was kinda hoping that there was something but figured there wasn’t.

        As I progress through the project I’ll dig in to what I need to do to ensure my feature can be hosted inside a Mashup. I’m pretty sure I saw mention of it when skimming the documentation and it looked pretty straight forward.

        I particularly like the comment on what you can or can’t (or shouldn’t) do in Jscript. The release of the SDK to us I believe will really help people like myself move further away from the “shouldn’t” do 🙂

        Cheers,
        Scott

  2. Pingback: Hello World of Infor Smart Office SDK | M3 ideas

  3. Salem says:

    Hello. Thank You for your post. I unstalled SDK and can see “developer” in starting of LSO (from VS2012). But I can’t find “sample” in navigator (i tried “sample1://helloworld” without any success). Can You help me please ? Thank you.
    Salem

    • potatoit says:

      It sounds like the compiled ‘features’ haven’t loaded. You can verify this by clicking on the ? near the top left in Smart Office -> About Infor Smart Office
      Click on View Features.

      This will list all of the features currently loaded. When you click on an entry it will show you the scheme needed to run.

      • Hello,

        I have the same problem as salem… But when I go to the about page I do not see any features loaded…

        I am trying to run the samples project So I guess there is something wrong with the setup or something like that? Do you know how I can debug this?

      • potatoit says:

        In the MangoClient project, does it have a reference to HelloWorld? I’d also check the readme.txt with the samples and double check any set up required there.

  4. I did the install on an other machine and it kinda works… I see the widgets but I cant open the hello world app …

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s