Category Archives: JScript

Calling M3 APIs in JScript on a Background Thread

In 9.1.3 we introduced a generic support for running any M3 API without having to create WS Stubs. If you are on a previous version you can still call a web service but it requires much more work including the use of Smart Office SDK. All calls to M3 APIs have to be done on a background thread!

There is simply no excuse for doing this the incorrect way. If you call the web service on the UI thread the entire UI will freeze for the time period that the call takes. In normal cases this will not be noticable but that does not matter. No calls to other servers on the UI thread.

Continue reading

Selecting the first row in a M3 list to trigger CurrentItemChanged

When you have a M3 list in a Mashup a common scenario is that you would like to have the first row selected so that any dependant mashup control can react to CurrentItemChanged.

This is for example a scenario when you open the Mashup from a panel with JScript so that you pass in a Customer id, CUNO. You want to load related information right away. This requirement is something that we will consider for future versions to have an option to say, ‘select first line on startup’.

But until then there is a workaround that involves using a JScript to set the selected item in the list. I’ll do an example with a mashup that loads CRS610 and reacts to CurrentItemChanged to load related data in a MIPanel. Continue reading

Calling M3 APIs

For easy access to M3 APIs we have created a few classes that you can use both in your JScripts and in your features. For those of you who don’t know the difference, JScripts are used on a standard M3 and S3 forms to add new functionality. A feature is an application that runs natively within Lawson Smart Office. This is the way we build the UI to our applications such as M3, S3, LBI, Process Server, Document Archive… to mention a few.

I got a question from one of our Solution Consultants, Peter Johansson. He was using MIAccess to get customer data but he was experience delays due to the amount of data.

“Is there a way to specify which fields should be returned by the API?”

Of course there is! Continue reading