Cannot Revert to NEW from Normal Implement Change

StacyLen
Mega Guru

I have created a new Change Model Transition State to allow for going from Normal Change in Implement State to the NEW State.  (See attached screen shot)

 

However, I still get an error message, "State Model for normal Changes does not allow reverting Change from Implement state"

 

I am using UI as shown in attached image

 

This is my include Script (Thanks to Help from this forum)

var ConditionUtils = Class.create();
ConditionUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {

// need change types of Standard and Normal
// need change states of Scheduled, Implement

 checkMyCondition: function(current) {
     
    if ((current.type == global.ChangeRequest.NORMAL && new global.ChangeRequest(current).isScheduled()) || (current.type == global.ChangeRequest.NORMAL && new global.ChangeRequest(current).isImplement()) && gs.getUser().isMemberOf('9d385017c611428711d22104ce95c371') && (current.type == ChangeRequest.STANDARD && new ChangeRequest(current).isScheduled()) || (current.type == ChangeRequest.STANDARD && new ChangeRequest(current).isImplement()) || (current.type == changeRequest.NORMAL && new ChangeRequest(current).isAuthorize()))


            return true;
        else
             var changeRequest = new ChangeRequest(current);
    if (!changeRequest.revertToNew())
        gs.addErrorMessage(gs.getMessage('State Model for {0} changes does not allow reverting change from {1} state', [changeRequest.getValue('type'), changeRequest.getDisplayValue('state')]));
    action.setRedirectURL(current);
            return false;
    },

    type: 'ConditionUtils'
});

 

Please Advise

Stacy Len

3 REPLIES 3

GlideFather
Tera Patron

Hi @StacyLen,

 

is that change record that you use for testing created before or after the state change transition?

 

If you create something "new" the legacy records existing before that might be (sometimes) running on the configurations actual to their creation.

 

Or it is a new change created after that?

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


StacyLen
Mega Guru

The changes Im testing were in fact, created before the new transition state model was created.  I will try creating a new change to see if it works then.  Thanks

hi @StacyLen any progress?

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */