How-toInfor M3 (M3 Business Engine)M3 H5 Client / UI Scripting

How to Add a Personalization Script to an M3 H5 Panel

Question
How to add a personalization script in M3 H5 client

Also searched as

  • M3 H5 MForms scripting guide
  • how to run custom JavaScript on an M3 H5 panel
  • M3 H5 personalization script not triggering
  • M3 H5 client scripting API basics

Short answer

M3 H5 lets an administrator attach a JavaScript personalization script to a specific panel of a specific program, using the MForms client API to read fields, react to panel and field events, and adjust the UI (hide fields, set defaults, validate input) without modifying the underlying M3 program. Scripts are written and attached through Personalization mode in H5, saved against the panel/program combination, and deployed to the users or roles who should see the behavior.

Applies to: Infor M3 H5 Client (all supported CloudSuite/M3 Business Engine versions shipping the H5 UI)

Add a personalization script to an H5 panel

  1. 1Confirm you have Application Administrator (or equivalent personalization) rights in H5 - regular end users can personalize layout but not attach scripts.
  2. 2Open the target program and navigate to the exact panel where the behavior should apply; scripts attach at the panel level, not the whole program.
  3. 3Enter Personalization mode from the H5 toolbar/gear icon and open the scripting option for that panel.
  4. 4Write the script against the MForms client API, using panel-load and field-change event hooks rather than polling the DOM directly.
  5. 5Reference fields by their panel field name (visible in the panel's field properties, not the on-screen label) so the script keeps working if the label is later translated or renamed.
  6. 6Test the script in a non-production environment first, exercising both the normal path and edge cases (empty field, invalid value) before saving.
  7. 7Save the script against the panel and decide the deployment scope - all users, a specific role, or a specific user - matching how narrowly the behavior should apply.
  8. 8Document what the script does and why in a change log outside H5 itself, since personalization scripts do not show up in standard M3 program documentation or upgrade impact reports.

What personalization scripts are for

H5 personalization scripts exist for the class of UI change that is too specific to justify a real program modification: defaulting a field based on another field's value, hiding a field that is irrelevant for one company or division, adding client-side validation before a user submits, or auto-formatting an input. They run entirely in the browser session and do not change the underlying M3 program, API behavior, or data model - which is exactly why they are the right tool for cosmetic and convenience logic, and the wrong tool for anything that needs to be enforced consistently regardless of which client calls M3 (a batch job or API integration will never see this UI logic).

Because scripts are attached per panel and are invisible to anyone not looking specifically in Personalization mode, they are easy to forget about. A field that mysteriously defaults or a validation message nobody can find in the program's setup is a strong sign a personalization script is involved somewhere.

Working with the MForms API

The MForms object is the client-side API H5 scripts use to interact with the panel: reading and setting field values, listening for field-change and panel-load events, and controlling visibility or enabled state of fields on the current panel. Scripts should hook the specific events they need (a field's change event, the panel's load event) rather than running continuous checks, both for performance and because H5's panel lifecycle does not guarantee a stable DOM to poll against between events.

Keep scripts defensive: check that a field exists and has a value before acting on it, since the same panel can appear in slightly different states (add mode versus change mode, different field visibility by role) and a script written against one state can throw errors in another.

// Simplified pattern - actual MForms API calls vary by H5 version
MForms.onFieldChange("WHLO", function(value) {
  if (value === "CENTRAL") {
    MForms.setFieldValue("TEDL", "DEFAULT-ROUTE");
  }
});

Deployment scope and upgrade risk

Deploying a script broadly (all users of a panel) versus narrowly (one role or one user) is a real tradeoff: broad deployment means the behavior is consistent but any bug affects everyone immediately, while narrow deployment limits blast radius but creates inconsistent behavior across the user base that is easy to lose track of. Keep an inventory of which panels have active personalization scripts and who they are scoped to, since H5 does not surface this centrally and it is easy to accumulate scripts that nobody remembers writing.

Personalization scripts generally survive M3 platform updates since they sit outside the core program, but a field rename, a panel redesign, or a CloudSuite update that changes panel structure can silently break a script that referenced the old field name or layout. Re-test personalization scripts as part of your update/upgrade regression pass, not just the core program functionality.

Common pitfalls

  • !Using a personalization script to enforce a business rule that really needs to apply everywhere, including batch jobs and API calls, which the script will never see.
  • !Referencing a field by its on-screen label instead of its panel field name, breaking the script when the label is translated or edited.
  • !Polling the DOM continuously instead of hooking MForms field-change and panel-load events, which hurts performance and behaves inconsistently across panel states.
  • !Not testing add mode, change mode, and different role-based field visibility before deploying a script broadly.
  • !Losing track of which panels have scripts attached, since H5 has no single central inventory view most administrators check regularly.
  • !Skipping personalization scripts during upgrade or update testing because they are not part of the core program.

How an ERP-grounded AI assistant handles this

ERPray can inventory which H5 panels across your M3 environment have personalization scripts attached and summarize what each one does in plain language by reading the script logic, which is useful before an update or a handover, when nobody currently remembers every piece of client-side customization that has accumulated over time.

Frequently asked questions

Do personalization scripts require a developer license or SDK?

No separate license is typically required beyond Application Administrator rights and H5 access; scripts are written and attached directly in the H5 UI's Personalization mode using standard JavaScript against the MForms API.

Can a personalization script call an M3 API transaction directly?

Scripts are scoped to client-side panel interaction, not arbitrary backend calls. Logic that needs to read or write other M3 data beyond the current panel is better handled through a proper extension or integration, not a personalization script.

Why did my script stop working after a CloudSuite update?

A panel layout change, field rename, or MForms API adjustment in the update can break a script that assumed the previous structure. Compare the script's field references against the current panel's field names first.

Can I copy a personalization script from one panel to another similar panel?

You can reuse the logic, but field names and available events can differ even between visually similar panels on different programs, so treat it as a starting point to adapt and retest rather than a direct copy that will work unchanged.

Related

Error fix

M3 API Error: Record already exist

Record already exist means the MI Add transaction you called is trying to insert a key that is already present in the target M3 table, most often because a prior call succeeded and was retried, or because the key fields you built do not match what you think they match. Read the errorField and errorFieldGroup attributes on the response to see exactly which key field M3 flagged, then either switch to the matching Chg (change) transaction or fix the key construction in the caller.

Error fix

M3 API Error: Not Authorized to Program

Not authorized to program (or the equivalent transaction-level authorization error) means the M3 user ID the integration authenticates as can log in fine but has not been granted access to that specific MI program, transaction, or company/division through its authority group. Fixing it means adding the program/transaction to the integration user's authority group in M3, not changing anything in the calling code.

How-to

How to Build a Grid Mapping in M3 Enterprise Collaborator (MEC)

M3 Enterprise Collaborator (MEC) moves data between an external format (EDI, flat file, XML) and M3's own API by chaining a collection step (getting the document in), a grid mapping step (field-level transformation from source structure to M3 API call structure), and a delivery step (executing the mapped MI transaction). Building a new mapping means defining the source document structure, building the grid that maps each source field to its M3 API field, and testing with representative sample documents before going live.

Advanced

Paging M3 API MI List Transactions Past the Default Record Limit

M3 List transactions (the read/browse transaction most MI programs expose, such as CRS610MI.LstByNumber or OIS100MI.LstOrderHead) cap the rows returned per call using the MaxReturnedRecords input field, and by default many clients leave it low or unset, which looks like the API silently truncating results. Set MaxReturnedRecords explicitly, then loop the call using the last key values from the previous page as the starting position until fewer rows than the limit come back.

How-to

How to Create a New Item in M3 (MMS001)

A new item in M3 is created in two stages: item basic data in MMS001 (Item. Open), which defines company-wide attributes such as description, item group and unit of measure, then facility-level data in MMS002 (Item/Facility. Connect), which attaches the item to a specific warehouse or plant with purchasing, planning and costing parameters. An item is not usable for orders, purchasing or MRP until both stages are complete.

How-to

How to Enter a Customer Order in M3 (OIS100)

OIS100 (Customer Order. Open) is the primary M3 program for entering and maintaining customer orders, built as a header-then-line workflow: you first create the order header with customer, order type and delivery terms, then add order lines that each carry their own item, quantity, price and delivery date defaulted from customer and item agreements.

AI for ERP

AI for Infor M3: A Practical Path from MI Programs to a Private Assistant

Add grounded AI to Infor M3: natural-language answers over MI programs and MEC, agents for distribution and manufacturing, on-prem or private cloud in Europe.

AI for ERP

What an Infor AI Consulting Partner Should Actually Deliver

A CIO's guide to Infor AI consulting: what a partner should deliver on ION API, IDOs, and Data Lake, how it relates to Coleman AI, and questions to ask.

Stuck on Infor M3 (M3 Business Engine)?

Talk to engineers who work inside Infor M3 (M3 Business Engine) every week, and who build private AI that answers these questions from your own ERP data.