We have written a mforms automation with an H5 script. The mforms automation works fine, however in the background, the tabs are not getting closed. Therefore, if the script runs 10 times in a row, the maximum number of tabs are opened in the background and the script doesn't work anymore. The tabs are not visible - also if you try to open another program, after the mforms automation runned 10 times, a pop-up appears "Only 10 tabs or windows at the time can be open" and you need to reflesh the page in order to close the tabs in the background. This is strange, because in the mforms automation, we use "F3" to close the tab.
Input:
itemnumber from MMS002/I
banoarr, array that stores the lot numbers (BANO from MWS068) for each itemnumber.
var auto = new MFormsAutomation();
auto.addStep(ActionType.Run, 'MMS130');
for (let i = 0; i < banoarr.length; i++) {
auto.addStep(ActionType.Set);
auto.addField('WWITNO', itemnumber);
auto.addField('WWBANO', banoarr[i][0]);
auto.addField('WACALT', '0');
auto.addStep(ActionType.Key, 'ENTER');
auto.addStep(ActionType.Set);
auto.addField('WWCNDT', banoarr[i][1]);
auto.addField('WWSEDT', banoarr[i][1]);
auto.addStep(ActionType.Key, 'ENTER');
}
auto.addStep(ActionType.Key, 'F3');
auto.addStep(ActionType.Run, 'MMS080');
auto.addStep(ActionType.Set);
auto.addField('WWWHLO', 'C01');
auto.addField('WWITNO', itemnumber);
auto.addStep(ActionType.Key, 'ENTER');
auto.addStep(ActionType.Key, 'F18');
auto.addStep(ActionType.Key, 'F3');
const uri = auto.toEncodedUri();ScriptUtil.Launch(uri);