Category Archives: JScript

Script assemblies in MForms

The most common way to extend the functionality of M3 panels in MForms is to use JScript files but there are other options such as Script assemblies and MForms extensions. With Script assemblies you can write code in most languages supported by .NET such as C# and VB.Net and you can actually debug your code using Visual Studio. Instead of deploying the script as a JScript file you use a .NET assembly in the form of a DLL file.

Continue reading

Getting values from M3 panels with Jscript

Almost every M3 script needs to get values from the panel it is running on at some point and there are quite a few different ways to accomplish this. The script might need the value of a specific TextBox, the value of a cell on the selected list row or it might need to know what the name of the current program is. These are just a few examples and there are many more. This post will show how to get values from M3 panels in the most common scenarios.

Continue reading

Tooltips with MI data in M3 lists

A script requirement we recently heard of was to be able to show tooltips on cells in a M3 list and that the tooltip value should be retrieved using a MI-program. The specific requirement was to get the user name for list columns that contains M3 user IDs. The idea is to use this in M3 lists where the user ID is shown in a column but the user name is not part of the list. Continue reading

Using M3 language constants in JScript

Using M3 language constants in JScript is a requirement that has been received from several sources recently. In Mashups it has been possible to use M3 constants and messages for some time using the markup extension MForms.Mashup.ConstantExtension. JScript developers however have been out of luck and have had to use other means of translating texts in scripts that targets more than one language. Continue reading

How to Create a Shortcut on the Canvas using JScript

Shortcuts on the Canvas are a quick way to start your favorite programs. In this post I’ll show you how to use Jscripts in order to create a shortcut on the Canvas. I’ll also show you how you can find out if the shortcut is already on the canvas in case you want to add it only if it is not already on the canvas. Continue reading

Improvements in JScript logging

Introduction

Since there is no way to debug a JScript in LSO developers have to use other means to find errors. This can include writing to the debug console in the Script Tool, writing to the Smart Office log file or the classic, showing dialog boxes.

In many cases you want to write both to the debug console for development purposes and to the log file for troubleshooting deployed scripts. One way to solve this is to create your own wrapper functions that does both these things and some of you have probably done this already. To make logging a bit easier from JScript we have added some new methods and properties to the ScriptDebugConsole class. First I will describe how a log wrapper function might be implemented and then how the new API methods can be used to remove the need for a wrapper function. Continue reading