maximo anywhere - Customization mixin Best Practice for StatusChangeHandler.commitWOStatusChange -


i tried best practice posted here: https://www.ibm.com/developerworks/community/blogs/a9ba1efe-b731-4317-9724-a181d6155e3a/entry/best_practices_for_customizing_maximo_anywhere_javascript?lang=en customizing statuschangehandler.commitwostatuschange function.

took copy of original function described:

var originalcommitwostatuschange = statuschangehandler.commitwostatuschange 

then wanted use such:

commitwostatuschange: function(eventcontext) {  if(conditionsarefalse) {     message user fix conditions; } else {     originalcommitwostatuschange(eventcontext); } 

essentially want ensure allowed perform status change according custom conditions (worklog entered example).

however when framework hits code, executes original function without testing conditions. seems variable store function causes run , ignore rest of code.

am doing in right manner or need follow different process control running of change status?

if remove variable can hit code calling original function directly after fires out errors.

thanks

bill

our application handlers dojo "declare" classes have overridden differently other javascript files.

here's example class overrides existing statuschangehandler.js method.

define("application/handlers/extendedstatuschangehandler",         [ "dojo/_base/declare",          "application/handlers/statuschangehandler",          ], function(declare, statuschangehandler) {     return declare( statuschangehandler, {          /**          * commit changes wo status (handle ok button clicked)          * @function          * @param {string} eventcontext - javascript variables context.          */         commitwostatuschange: function(eventcontext){             if (true)                 console.error("custom wo status change");             else {                 this.inherited(arguments);             }         },       }); }); 

you need replace references statuschangehandler in app.xml extendedstatuschangehandler loaded app.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -