Posts

Showing posts from July, 2011

CRM 2011 Custom Button on Custom Entity to trigger Workflow through JavaScript

Image
I will provide detailed step on what I did to do this. The objective of my example is to have a custom button 'Create Opportunity' on my custom entity that triggers a workflow to create an Opportunity. This way the users don't have to click 'Run Workflow' and choose which workflow they want to run. You can also alter the JavaScript to do other stuff as well. There are three places where we should put the button mainly: 1. Custom Entity Form 2. Homepage Grid 3. Sub Grid THE STEPS: 1. In order to inspect the correct sequence number of where the button will be placed on each section, you can first run the tool provided from the sdk \sdk\samplecode\cs\client\ribbon\exportribbonxml . Just modify the exportribbonxml.cs to only generate the entity you are interested in: Run the tool program, specify your server connection and it should give you the XML in the output folder with the name Ribbon.xml . Open the xml, search for the sections and write down th...

CRM 2011 Javascript Functions

Starting to use CRM 2011, here are some useful javascript reference (this list will get longer and longer as time goes): Hide/Show Field Hide/Show Field but removing white space Disable/Not Disable Field Set Requirement Level Set Required Level Validate Number Field and Character Limit Validate Future DateTime Example function to hide left navigation item based on a condition Avoiding the checkbox OnChange bug so that it fires off immediately (put this in OnLoad event of the form) Set Lookup Value Hide Picklist Item Text