Author Topic: Error display logs as status message  (Read 6553 times)

rajesh.sabbineni

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 26
    • View Profile
Error display logs as status message
« on: August 08, 2017, 03:47:37 PM »
Purpose:
Some of the error messages will be displayed in a log. These messages should be displayed on status bar

Liquid UI Code:

//SAPLMIGO.E0001.sjs

//User interface
pushbutton([1,72], "Display log message",{ "process":logs_message});

// Function to display message on status bar

function logs_message(){
   onscreen 'SAPLMIGO.0001'
      set('F[Material]', '100-300');
      enter();

// Function prototype to trim blank characters from a string
String.prototype.trim = function () {
   return this.replace(/^\s+|\s+$/g, "");
}

   // Goods Issue Other
   onscreen 'SAPLMIGO.0001'
      enter('/7');  //Check

   // Goods Issue Other
   onscreen 'SAPLSBAL_DISPLAY.0120'
      for(j=0; j<3; j++){
         rb = new Reebok([2+j,1]);
         if(rb.name.toString().indexOf("Warning")>-1){
            if(isBlank(msg_type)){
               msg_type = 'W:';
               rb2 = new Reebok([2+j,10]);
               msg_content = rb2.name.substring(rb2.name.indexOf("@",2)+1, rb2.name.length).trim();
            }
         } else if(rb.name.toString().indexOf("Error")>-1){
            msg_type = 'E:';
            rb2 = new Reebok([2+j,10]);
            msg_content = rb2.name.substring(rb2.name.indexOf("@",2)+1, rb2.name.length).trim();
            break;
         }
      }
      enter();

   onscreen 'SAPLMIGO.0001'
      if(msg_type == 'E:'){
         message("E:"+msg_content);
      }   
      enter('?');
}

See attachments for code samples!
« Last Edit: September 17, 2018, 12:21:48 AM by sarvani.kusuri@guixt.com »