Triggering FieldChange from JavaScript

Опубликовано: 17 Май 2026
на канале: JSMpros
1,450
27

Trigger event #PeopleSoft processing when someone presses the enter key! Here is the scenario: your users scan values with a barcode scanner, and that scanner automatically sends the enter key on completion. Unfortunately, PeopleSoft doesn't respond to the enter key. In this episode, we'll show you how to inject a JavaScript fragment to trigger FieldChange and other event processing when the browser receives the enter key press.

My Oracle Support Document ID: https://support.oracle.com/epmos/face...

JavaScript used in this episode:

(function () {
/* Replace id with the ID of the element that has a new value */
var id = "JSM_TEST_WRK_ROLENAME";

if (!window.zxc) {
window.zxc = {};
}

window.zxc.scannerEnterKeyHandler = function(keyEvent) {
if (keyEvent.code === 'Enter') {
keyEvent.preventDefault(); // Ensure it is only this code that runs

var el = document.getElementById(id);

/* Setup any PeopleSoft-specific change handling */
el.onchange();

/* Trigger Ajax submission */
/* %FormName is a PeopleSoft Meta-HTML variable */
submitAction_%FormName(document.%FormName, id);
}
}
}());

PeopleCode:
AddJavaScript(HTML.JSM_TRIGGER_FC_JS);
JSM_TEST_WRK.ROLENAME.JavaScriptEvents = "onkeypress='zxc.scannerEnterKeyHandler(event)'";

JSMpros Sound Bytes are short 5 to 15-minute videos sharing #PeopleSoft #PeopleTools ideas. Do you have an idea you would like us to cover? Share it with us at https://soundbytes.jsmpros.com/!

Jim Marion is an #OracleAce ♠, author of several PeopleTools books, blogger, public speaker, and PeopleTools instructor. Connect with Jim on LinkedIn at   / jimjmarion  .