Category Archives: Java Script

Getting Contract Details on Contract Line Form

I just came across scenario where we wanted to know contract details on Contract Line form and to my surprise you can not added contract look up on contract line form in CRM. Check it out you will be surprised too 🙂

Well after using IE Developer tool I found that there is hidden field which holds the contract GUID on this contract line form.

So you can use following line to get contract GUID on contract line form.

alert (crmForm.all.contractid.DataValue);

Hope this helps some one as well…


Collapse/Expand Form Section in CRM 4.0

Recently during one of the customer’s implementation we found that particular form section have got lots of fields and all of them we important and can’t be moved to different tab.

So we had to research on alternative to make Form‘s usability and now there were few options

1. Put button or like – on click of which relevant form section’s will be shown or hidden

2. Put the Navigation Image on relevant section and user can collapse /Expand form as per their wish (similar to already present on left hand navigation pane)

Now thanks to Marco Amoedo who have already implemented second option and also shared the full solution code on this URL.

As per this Post, This feature will be by default available in CRM 5.0 and no need to put any code at all but for CRM 4.0 have to put this really nice java script code on the relevant form.
I did the prototype for the option 1 as well but customer really like the option 2 and we went ahead with this option.
So you know how to make CRM Form Section collapsible.
Hope this helps..

CRM 4.0 Java Script “Error: Access is denied”

If you have written Fetch Xml code using Java script then there would be case when specific user will get the following error

“This page is accessing information that is not under its control. Thos poses a security risk. Do you want to continue?

Case Page

And then if user continues it gets following error

Case Page

Potential Solution:
 Click on Tools in the Internet Explorer tool bar menu and
 Then select Internet Options from the drop down.
 Now click the Security tab and then click the “Custom Level” button.
 Once this is open scroll down until you see the “Access data sources across domains” setting and set the radial button to enable.
 Click the OK button followed by the Apply button to save the settings

Hope this helps