As we know that form assistant has been removed from MS CRM 2011 release. But it is available for very few special usages (such as Case and Service Activity).
Recently, I got to know that there will be No Biztalk adapter for 2011.
The reason behind this is BizTalk Adapter for CRM 4.0 is being deprecated in favor of enabling the OOB BizTalk WCF adapter to work with CRM 2011's WCF endpoint for On-premised and IFD deployments.
Sometime we require to set all attributes on a form to disabled or checking which attribute has been changed.
To achieve this, you need to loop through each attribute of the CRM form. Below is the code snippet :
var iLen = crmForm.all.length;
for (i = 0; i < iLen; i++) { o = crmForm.all[i]; switch (o.tagName) { case "INPUT": case "SELECT": case "TEXTAREA": case "IMG": case "IFRAME": if (o.id != "leadqualitycode") { o.disabled = true; } break;
default: break; } }
The above code will set all attributes to disabled.
The OnSave event is fired when a user presses the Save or Save and Close button on the form. The event is fired whether the data in the form has been modified or not.
Validating data is a common reason to use the OnSave event. The OnSave event can cancel the save operation before it is sent back to the server. To cancel the save operation, the script should return false as shown in the following code.
event.returnValue = false;
The SDK helps in this situation. Look at the following page for more information. MSDN SDK: OnSave Event
I needed to hide a button that I added to my form using the ISV.config file. IN ISV file you can specify the button to be display in create / update mode. You can have only one tag per entity.
Here is the requirement: I have to display 5 ISV button in the form. Out of which 4 to be displayed in both Create and Update mode. But there is one button which has to be displayed only in Update Mode. If you use below XML line in ISV.config file It will display all button in both mode. But there is no provision where i can specify some of the button in create and update mode. So I've to hide the button using Client side scripting on Load of the form.
Below is the fucntion which hides the button: // HIDE ISV Button function HideISVButton(strButtonToolTip){ var tag = document.getElementsByTagName("LI"); for(x = 0; x < tag.length; x++) { if(tag[x].getAttribute("title") == strButtonToolTip) { button = document.getElementById(tag[x].getAttribute("id")); if(button != null) button.style.display = "none"; x = tag.length; } } }
// Call the function to hide the button: HideISVButton("Click this button to Line Activate");
The above code loops through all objects on the webpage with a tag name of "LI" looking for one that has a title of ‘Click this button to Line Activate’ which is specified in the ISV.Config file. Once the code finds the correct ToolTip of a button, it gets hidden.