Infor M3 H5 Development Guide

Infor M3 H5 Development Guide

Version 10.3.1.0

Published May 2017

Copyright ? 2017 Infor

Important Notices

The material contained in this publication (including any supplementary information) constitutes and

contains confidential and proprietary information of Infor.

By gaining access to the attached, you acknowledge and agree that the material (including any

modification, translation or adaptation of the material) and all copyright, trade secrets and all other

right, title and interest therein, are the sole property of Infor and that you shall not gain right, title or

interest in the material (including any modification, translation or adaptation of the material) by virtue

of your review thereof other than the non-exclusive right to use the material solely in connection with

and the furtherance of your license and use of software made available to your company from Infor

pursuant to a separate agreement, the terms of which separate agreement shall govern your use of

this material and all supplemental related materials ("Purpose").

In addition, by accessing the enclosed material, you acknowledge and agree that you are required to

maintain such material in strict confidence and that your use of such material is limited to the

Purpose described above. Although Infor has taken due care to ensure that the material included in

this publication is accurate and complete, Infor cannot warrant that the information contained in this

publication is complete, does not contain typographical or other errors, or will meet your specific

requirements. As such, Infor does not assume and hereby disclaims all liability, consequential or

otherwise, for any loss or damage to any person or entity which is caused by or relates to errors or

omissions in this publication (including any supplementary information), whether such errors or

omissions result from negligence, accident or any other cause.

Without limitation, U.S. export control laws and other applicable export and import laws govern your

use of this material and you will neither export or re-export, directly or indirectly, this material nor any

related materials or supplemental information in violation of such laws, or use such materials for any

purpose prohibited by such laws.

Trademark Acknowledgements

The word and design marks set forth herein are trademarks and/or registered trademarks of Infor

and/or related affiliates and subsidiaries. All rights reserved. All other company, product, trade or

service names referenced may be registered trademarks or trademarks of their respective owners.

Publication Information

Release: Infor M3 H5 10.3.1.0

Publication date: < May 10, 2017 >

Contents

About this guide ................................................................................................................................... 9

Related documents .......................................................................................................................... 9

Contacting Infor................................................................................................................................ 9

The H5 Scripting Blog .................................................................................................................... 10

Chapter 1

Introduction .................................................................................................................. 11

Scripting overview .......................................................................................................................... 11

Resources ...................................................................................................................................... 11

Creating a script in M3 H5 ............................................................................................................. 12

Contents of a script file .................................................................................................................. 12

Example Script......................................................................................................................... 12

Init method ............................................................................................................................... 12

Element parameter .................................................................................................................. 13

Args parameter ........................................................................................................................ 13

Controller parameter................................................................................................................ 13

Log parameter ......................................................................................................................... 13

Debug parameter (deprecated) ............................................................................................... 13

M3 H5 limitations ........................................................................................................................... 14

M3 H5 script minification................................................................................................................ 14

Chapter 2

Developing scripts ....................................................................................................... 15

Development environment ............................................................................................................. 15

Prerequisites ............................................................................................................................ 15

Using Visual Studio ................................................................................................................. 15

Configuring the project ...................................................................................................... 15

Running Samples .............................................................................................................. 16

Debugging ......................................................................................................................... 16

Adding a new script to the solution ................................................................................... 17

Using VS Code and Node.js .................................................................................................... 17

Infor M3 H5 Development Guide | 3

Contents

Opening project in VS Code .............................................................................................. 17

Running Samples on a Node.js server ............................................................................. 17

Adding a new script to the project ..................................................................................... 18

Debugging in browsers ............................................................................................................ 18

MForms Panel Layout .................................................................................................................... 18

Adding Content to a Form ....................................................................................................... 19

Element layout ......................................................................................................................... 19

Events ...................................................................................................................................... 19

Example ................................................................................................................................... 19

Chapter 3

Deploying scripts ......................................................................................................... 21

Deploying a customized script in M3 H5 ....................................................................................... 21

Chapter 4

Adding scripts to a form ............................................................................................. 23

Adding a personalized script to a form .......................................................................................... 23

Adding a script shortcut ................................................................................................................. 23

Chapter 5

Public APIs.................................................................................................................... 25

API Overview ................................................................................................................................. 25

InstanceController .......................................................................................................................... 25

Properties ................................................................................................................................ 25

RenderEngine: RenderEngine .................................................................................. 25

Requesting: InstanceEvent .................................................................................... 26

Requested: InstanceEvent ...................................................................................... 26

RequestCompleted: InstanceEvent ....................................................................... 26

Functions ................................................................................................................................. 26

GetContent() ...................................................................................................................... 26

GetContentElement() ........................................................................................................ 26

GetElement() ..................................................................................................................... 26

GetGrid()............................................................................................................................ 27

GetInstanceId() .................................................................................................................. 27

GetMode() ......................................................................................................................... 27

GetPanelName() ............................................................................................................... 27

GetProgramName() ........................................................................................................... 28

GetSortingOrder().............................................................................................................. 28

GetValue() ......................................................................................................................... 28

GetView()........................................................................................................................... 28

ListOption() ........................................................................................................................ 29

4 | Infor M3 H5 Development Guide

Contents

PageDown()....................................................................................................................... 29

PressKey() ......................................................................................................................... 29

SetValue().......................................................................................................................... 29

ShowMessage() ................................................................................................................ 30

ShowMessageInStatusBar() ............................................................................................. 30

Request Event Arguments ............................................................................................................. 30

RequestEventArgs .............................................................................................................. 30

CancelRequestEventArgs ................................................................................................. 30

RenderEngine ................................................................................................................................ 31

Properties ................................................................................................................................ 31

Content: ContentElement ........................................................................................ 31

Functions ................................................................................................................................. 31

ShowMessage() ................................................................................................................ 31

ListControl ...................................................................................................................................... 31

Properties ................................................................................................................................ 32

ListView ......................................................................................................................... 32

Functions ................................................................................................................................. 32

Columns() .......................................................................................................................... 32

GetColumnIndexByName() ............................................................................................... 32

Headers()........................................................................................................................... 32

ListView .......................................................................................................................................... 33

Functions ................................................................................................................................. 33

GetValueByColumnIndex() ............................................................................................... 33

GetValueByColumnName()............................................................................................... 33

SelectedItem() ................................................................................................................... 33

SetValueByColumnIndex() ................................................................................................ 34

SetValueByColumnName() ............................................................................................... 34

ScriptDebugConsole (deprecated) ................................................................................................ 34

Functions ................................................................................................................................. 35

WriteLine() ......................................................................................................................... 35

Clear()................................................................................................................................ 35

ScriptLog ........................................................................................................................................ 35

Functions ................................................................................................................................. 35

Error() ................................................................................................................................ 35

Warning() ........................................................................................................................... 36

Info() .................................................................................................................................. 36

Debug().............................................................................................................................. 36

Infor M3 H5 Development Guide | 5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download