Tuesday, November 24, 2009

Smart Client / Smart Office scripting


With SmartClient Lawson introduced powerful extensibility through Mforms scripting.  This is documented in "Lawson Smart Office and Lawson Smart Client MForms Developers Guide" available from their knowledge base.

Smart Client / Smart Office functionality is exposed through the javascript language and APIs.

A couple of examples of how I've made use of this functionality: 


Create connections between programs that do not exist in the related options menu.  For example after performing a stock adjustment in MMS100 we needed to print a lot label with the current stock balance.  I added a button to MMS101 "Print Label" which called MMS235 Lot/Serial.Open, passed in the Item number and lot number and then chose Related Options, Print Label.  This brought the functionality available within M3 into a workflow that made operational sense.


Perform multiple tasks quickly.  For example in PMS100 we wanted to change all the MOs in a Schedule to reflect changes in expected manufacturing completion dates.  I added a "Reschedule" button and a text box for the new date then scripted a loop which parsed through all the MOs listed and added a new entry in PMS010 MO Reschedule for each item in the list.  This allowed the staff member to easily update the finish dates on large numbers of MOs, ensuring the Material Plan for these items was correct and allowing shortages to be easily identified.

Once scripts are developed these are deployed easily by placing them in the appropriate directory on the Smart Client / Smart Office websphere server and attaching the script to a program either on a per-user basis or via a template to all users.

Mforms scripting is undoubtedly a powerful capability added to the Lawson toolset.  The documentation provided by Lawson could however do with more worked examples and the details on the APIs provided is quite limited.