Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Unbind AWF buttons?

jsol5
Advocate II

I know it is possible to unbind the onclick event for the Save and Save and Close buttons.

However, I don't seem to be able to do this for the Workflow buttons.

Wondering if this is possible.

 

Ultimately, I want to trigger the event if my criteria is OK, else do nothing.

25 REPLIES 25

UGH! I was using Chrome to test.  It's not working in IE 11. 

 

So, either I figure out the AWF buttons or go back to using setinterval. 

Strange, this site is showing that Observer works with IE11.

https://caniuse.com/#feat=mutationobserver 

 

Also, Mozilla developer site claims so:

pastedImage_1.png

Even on here, it looked to be ok. - MutationObserver - Web APIs | MDN 

However, the same code that works on chrome doesn't do anything in IE.

I get my expected warning alert in chrome but not i.e. 

 

Could be something else in my code, but strange it works fine in Chrome.

I'll keep at it!

Yeah, check out debug console in IE Dev Tool. It will show exact reason most likely.

Anonymous
Not applicable

I use custom objects to intercept AWF buttons especially when I need to do a Rule check since the AWF error message is generic.  Here is the snippet I use for intercept:

 

//Grab Transition tab info and store it
var TransitionClick = $('a[title="Rejected"]').prop("onclick");
//Resets tab to trigger validation
Sys.Application.add_load(function() {
    //Resets transition tab to validate rules
    $('a[title="Rejected"]').removeAttr('onclick').unbind('click');
    $('a[title="Rejected"]').prop("onclick", null);
    $('a[title="Rejected"]').click(function() {
        ValidateRules();
    });
});    
Then the ValidateRules function does all the checking. If validation succeeds then I exit to TransitionClick() and the record passes through.  To the user when they hit the button a detailed error message pops up if they are missing something otherwise the record saves and transitions on through AWF.

Thanks, David. That is what I also meant by to controlling click attribute for the button. Although, never tried myself

Great, if this is working for you, Jason can try if he does not make Observer to work with IE

You rock!

I haven't tried this out, yet.  Hopefully this works!

Anonymous
Not applicable

It has worked for me in 6.2-6.4.0.2.  I haven't test on 6.4 SP1 and higher yet. 

David,

This works perfectly.  Thanks again!

2 follow-up questions.  

Any ideas/explanation as to why the selecting the AWF button by ID didn't work?

 

Most processes are going to have more than 1 AWF button.  So, thoughts about trying to attach the event to ANY AWF button rather than selecting the individual one?  i.e. select elements by class.

I thought I'd ask you, since you seem to be knowledgeable in this area, before I started trying to do this on my own.

I think you can do it by class. For the ID, could it be that colon is preventing, though have not tried.

master_1288:CUST