Changing default filter for Contracts Associated View for Account.

For an account record, the associated view of Contract would have default filter set as Draft. So if we want to change it to some other status for example “Active” we can make use of the following JavaScript for that.

This JavaScript is based on the popular JavaScript code used for hiding “add existing button”

Please check this wonderful article

The JavaScript code for changing default option

var navElement = document.getElementById('navContracts');
 if (navElement != null) {
  navElement.onclick = function LoadAreaOverride()  {

function SetDefaultOption(Iframe) {
 if (Iframe != null ) {
  Iframe.onreadystatechange = function SetOption() {
   if (Iframe.readyState == 'complete') {
    var iFrame = frames[];
    var selectBox=iFrame.document.getElementById('statecode');



Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

One thought on “Changing default filter for Contracts Associated View for Account.”

Please share your thoughts

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.