Override standard events on buttons and links

By | May 11, 2010

Screen level customization is one of the very important integral parts of the large scale customizations we undertake for any organization. Sometimes we even need to change the behavior of standard buttons in Sage CRM. Now how do we go about this thing?

I have discussed on this blog site before regarding how to change the reference of the button or hyperlink. This can be easily achieved using some JavaScript. We need to find an object of the button or hyperlink on the screen and set its HREF property to ours like.

Btnobj.href = “javascript:fn_newonclick()”

This works fine, but in some cases you will find the standard scenario where href property is set as well as the on-click event is called. Now even if you change the href property it fires the standard on-click event. Now how do i over ride this standard on-click event to perform my custom actions. Well, on the on-load event of screen you can override this on-click event as follows.

Btnobj.onclick = function(){
//Write down your new on-click code over here}

If you find this content useful, Please drop us an email at crm@greytrix.com.