The Infor Communities is globally accessed system by Infor and its customers, please do not post or upload any content that could be deemed as sensitive, confidential or subject to any data regulation requirements. If you are unsure whether or not the content contains sensitive, confidential or has any data regulation requirements, please seek the advice of your internal security, legal, and compliance experts.

H5 script- How to stop being moved to next panel?

Hi,

I am developing a H5 script in APS100/E panel. This script gets triggered when the user clicks 'Add' button and will do some validation in APS100/E panel and will throw a Error message(ConfirmDialog) if the validation fails.
It is working fine as expected but unfortunately after the Error message Pop-Up, It is automatically navigating to the 'F' panel. Any idea how i can stop this from being moved to 'F' panel? I want it to remain in E-panel.

Parents
  • Greetings;

          and both have the correct answer.  I thought I'd share the code I use to help you along.

          Put this code in where the script initializes.  Remember to unsubscribe the events when you leave.

            this.unsubscribeRequesting = this.controller.Requesting.On((e) => { this.onRequesting(e); });
            this.unsubscribeRequested = this.controller.Requested.On((e) => { this.onRequested(e); });
    
     This is the actual function I use, it allows the users to go back, but runs the check when they try to advance.

        private onRequesting(args: CancelRequestEventArgs) {
            let panelName = this.controller.GetPanelName();
            ExchangeRate.appLog("onRequesting: " + panelName);
    
            if (args.commandType === "KEY" && args.commandValue === "F12") {
                return; // The user should be allowed to go back
            }
    
            if (args.commandType === "KEY" && args.commandValue === "F3") {
                return; // The user should be allowed to go back
            }
    
            if (args.commandType === "KEY" && args.commandValue === "ENTER") {
                args.cancel = this.PerformRateCheck();
                return;
            }
    
            return;
        }
    



    This is the unsubscribe I use.

        private onRequested(args: RequestEventArgs) {
            let panelName = this.controller.GetPanelName();
            ExchangeRate.appLog("onRequested: " + panelName);
    
            this.unsubscribeRequested();
            this.unsubscribeRequesting();
    
            return;
        }
    



    The PreformRateCheck function returns a bool which will block or allow the panel advancement.

    Good luck!

    Billy

Reply
  • Greetings;

          and both have the correct answer.  I thought I'd share the code I use to help you along.

          Put this code in where the script initializes.  Remember to unsubscribe the events when you leave.

            this.unsubscribeRequesting = this.controller.Requesting.On((e) => { this.onRequesting(e); });
            this.unsubscribeRequested = this.controller.Requested.On((e) => { this.onRequested(e); });
    
     This is the actual function I use, it allows the users to go back, but runs the check when they try to advance.

        private onRequesting(args: CancelRequestEventArgs) {
            let panelName = this.controller.GetPanelName();
            ExchangeRate.appLog("onRequesting: " + panelName);
    
            if (args.commandType === "KEY" && args.commandValue === "F12") {
                return; // The user should be allowed to go back
            }
    
            if (args.commandType === "KEY" && args.commandValue === "F3") {
                return; // The user should be allowed to go back
            }
    
            if (args.commandType === "KEY" && args.commandValue === "ENTER") {
                args.cancel = this.PerformRateCheck();
                return;
            }
    
            return;
        }
    



    This is the unsubscribe I use.

        private onRequested(args: RequestEventArgs) {
            let panelName = this.controller.GetPanelName();
            ExchangeRate.appLog("onRequested: " + panelName);
    
            this.unsubscribeRequested();
            this.unsubscribeRequesting();
    
            return;
        }
    



    The PreformRateCheck function returns a bool which will block or allow the panel advancement.

    Good luck!

    Billy

Children
No Data