Determine if Onload event of customized form is firing - or How do I debug it

Good afternoon, we have a customized form and it does not seem to be utlizing the custom onload event. I really can't tell but thats what I am thinking. This is the onload code below, can anyone see if there is something wrong with it?

Or if someone could tell me how to walk thru the form load in debug that would be good as well.

 /* ----- Start OnLoad ----- */ frmOnLoad(); onLoad = false; } catch(e) { alert(e.message); } }//End of if condition }//End of function /* Declare Variables */ var onLoad = true; var sGlobalVar = ''; function frmOnLoad() { ResizeScreen(); AddLogoToFormTitle(160, "/CRM4Legal/_imgs/reznick_small.gif"); fldMerge('name'); fldMerge('customerid'); fldMerge('rg_officeid'); fldStatus(); fldGSMC(); frmTabs(); frmNav(); frmIFrames(); if ($("rg_gsmc" ) != null) $("rg_gsmc" ).onclick = fldGSMC; } function fldStatus() { with ( crmForm.all ) { if ( statuscode.SelectedText == 'Won' || statuscode.SelectedText == 'Lost' ) { crmForm.SetFieldReqLevel("rg_winlossreason", 1); sectionDisplay( false, rg_winlossreason ); } else { crmForm.SetFieldReqLevel("rg_winlossreason", 0); rg_winlossreason.DataValue = null; sectionDisplay( true, rg_winlossreason ); } } } function fldGSMC() { with ( crmForm.all ) { sectionDisplay( !rg_gsmc.DataValue, rg_contractnumber ); crmForm.SetFieldReqLevel("rg_contracttype", ( rg_gsmc.DataValue ? 1 : 0 )); } } function fldMerge(fld) { if ( fld == null ) { return; } var cell = $(fld + '_d'); if ( cell == null ) { return; } var row = cell.parentNode; if ( row == null ) { return; } cell.colSpan = 3; row.removeChild(cell.nextSibling); row.removeChild(cell.nextSibling); } function frmTabs() { tab('Hidden', 'hidden'); } function frmNav() { navHide ('nav_rg_opportunity_rg_opportunitypracticearea'); navHide ('nav_rg_opportunity_rg_opportunityservicearea'); navHide ('nav_rg_opportunity_rg_engagementteam'); navHide ('nav_rg_opportunity_rg_opportunityteam'); navHide ('navProducts'); navHide ('navQuotes'); navHide ('navOrders'); navHide ('navInvoices'); navHide ('navComp'); navHide ('_NA_SFA');} function frmIFrames() { /* Engagement Team */ var n2nPA = new N2NViewer('IFRAME_EngagementTeam'); /* Set the role order - use iedevtoolber for exact parameters */ n2nPA.RoleOrder = 1; /* assing the relationship name (without the "area" word) */ n2nPA.TabsetId = "rg_opportunity_rg_engagementteam"; n2nPA.Load(); /* Opportunity Team */ var n2nPA = new N2NViewer('IFRAME_OpportunityTeam'); n2nPA.RoleOrder = 1; n2nPA.TabsetId = "rg_opportunity_rg_opportunityteam"; n2nPA.Load(); /* Practice Areas */ var n2nPA = new N2NViewer('IFRAME_PracticeAreas'); n2nPA.RoleOrder = 1; n2nPA.TabsetId = "rg_opportunity_rg_opportunitypracticearea"; n2nPA.Load(); /* Service Areas */ var n2nService = new N2NViewer('IFRAME_Services'); n2nService.RoleOrder = 1; n2nService.TabsetId = "rg_opportunity_rg_opportunityservicearea"; n2nService.Load(); } function $(name) { return document.getElementById(name); } function navHide (name) { if ($(name) != null) { $(name).style.display = "none"; } } function tab ( tabName, tabVisibility ) { tabVisibility = ( tabVisibility == "visible" ? "" : "none" ); var _tabs = crmForm.getElementsByTagName("li"); for (var i = 0; i < _tabs.length; i++) { var _tab = _tabsIdea; if ( _tab.innerText == tabName ) { _tab.style.display = tabVisibility; break; } } } function sectionDisplay(vis, sec) { sec.parentElement.parentElement.parentElement.style.display = ((vis) ? 'none' : 'block'); } function ResizeScreen() { var aH = screen.availHeight; var aW = screen.availWidth; var top = 0; var left = 0; if ( aW >= 1124 && aH >= 800) { var aH = (aH > 800 ? 800 : 768); var aW = 1124; var top = (screen.availHeight - aH) / 2; var left = (screen.availWidth - aW) / 2; } // aH = (crmForm.FormType == frmType.Create ? 295 : aH); window.moveTo(left, top); window.resizeTo(aW, aH); } function N2NViewer(iframeId) { if (!document.all[iframeId]) { alert(iframeId + " is missing!"); return; } var viewer = this; var _locAssocObj = null; viewer.IFRAME = document.all[iframeId]; viewer.RoleOrder; viewer.TabsetId; viewer.Load = function() { if (crmForm.ObjectId != null) { /* Construct a valid N2N IFRAME url */ viewer.IFRAME.src = "areas.aspx?oId=" + crmForm.ObjectId + "&oType=" + crmForm.ObjectTypeCode + "&security=" + crmFormSubmit.crmFormSubmitSecurity.value + "&roleOrd=" + viewer.RoleOrder + "&tabSet=" + viewer.TabsetId; viewer.IFRAME.onreadystatechange = viewer.StateChanged; } else { viewer.IFRAME.src = "about:blank"; } } viewer.StateChanged = function() { if (viewer.IFRAME.readyState != 'complete') { return; } var iframeDoc = viewer.IFRAME.contentWindow.document; /* Reomve scrolling space */ iframeDoc.body.scroll = "no"; /* Remove crmGrid Default padding */ iframeDoc.body.childNodes[0].rows[0].cells[0].style.padding = 0; /* Save MS locAssocObj */ _locAssocObj = locAssocObj; /* Override MS locAssocObj */ locAssocObj = viewer.locAssocObj; } viewer.locAssocObj = function(iType , sSubType, sAssociationName, iRoleOrdinal) { /* Open the Dialog */ _locAssocObj(iType , sSubType, sAssociationName, iRoleOrdinal); /* Refresh only if our iframe contains the correnct tabset name */ if (sAssociationName == viewer.TabsetId) { viewer.IFRAME.contentWindow.document.all.crmGrid.Refresh(); } } } function AddLogoToFormTitle(logoWidth, logoUrl) { var formTitleTable = null; var tables = document.getElementsByTagName("table"); for(var i = 0; i < tables.length; i++) { var className = tablesIdea.className; if (className && className.indexOf("ms-crm-Form-Title") == 0) { formTitleTable = tablesIdea; break; } } if (formTitleTable) { var newCell = formTitleTable.rows[0].insertCell(2); newCell.width = logoWidth; newCell.vAlign = "middle"; newCell.innerHTML = ''; } } function UnUsed() { if(false) { try {

Related
Recommended