In Microsoft Dynamics CRM 4.0, the buttons in the left navigation bar in the account entity cannot write JavaScript Functions in isV. Therefore, if you want to connect a report that requires parameter passing, there is a problem.
I want to write a code segment in onload in the account to change this situation.
1. Write the following code in onload in the account.
View Source
Print?
01 |
var CRM_FORM_TYPE_CREATE = 1; |
02 |
var CRM_FORM_TYPE_UPDATE = 2; |
03 |
var navId= "navTransactionsItem" |
04 |
if (crmForm.FormType ==CRM_FORM_TYPE_CREATE) |
07 |
displayLeftNavItem( 'Customer transaction information' , false ); |
09 |
else if (crmForm.FormType == CRM_FORM_TYPE_UPDATE ) |
11 |
if (document.getElementById(navId) != null ) |
13 |
var navElement = document.getElementById(navId); |
16 |
var accountcode = crmForm.all.accountnumber.DataValue; |
21 |
'https://crmtest.msfunds.com.cn/ReportServer/Pages/ReportViewer.aspx?%2fMSHF-DEV_MSCRM%2f%e5%ae%a2%e6%88%b7%e4%ba%a4%e6%98%93%e6%b5%81%e6%b0%b4&rs:Command=Render&CUSTID=' +accountcode; |
22 |
navElement.onclick = function LoadAreaOverride() { |
23 |
openIsvWin(url, false , -1, '' ) |
28 |
setLeftNavItemState( 'Customer transaction information' , true ); |
Note: The JavaScript function openisvwin is a global function specific to CRM 4.0 and is available anywhere. It enables the report to be loaded when you click the button in the left column, the setleftnavitemstate displayleftnavitem functions are defined by myself to show the hidden and enable the left sidebar buttons.
Effect