Add button in existing group of Ribbon


Let’s say, we want to add a custom button in Activity group of Contact and on click it will open a window to create CustomerVisits (new_customervisit) record which is a custom activity.

Steps:
Follow the below steps to create a button in existing group.
Step #1 Create a new solution say TestSolution.
Step #2 Open newly created TestSolution and the entity on which you want to button.I have added contact entity.
Step #3 Publish All Customization
Step #4 Export the TestSolution for editing.
Step #5 Open customization.xml file from exported solution for editing.
Step #6 Find out RibbonDiffXml tag and replace the code from <RibbonDiffXml> to </RibbonDiffXml>With below code.

 

<RibbonDiffXml>

<CustomActions>

<CustomAction Id=”CompanyName.Form.contact.Related.Activities.CustomerVisits.CustomAction” Location=”Mscrm.Form.contact.Related.Activities.Controls._children” Sequence=”41″>

<CommandUIDefinition>

<Button Id=”CompanyName.Form.contact.Related.Activities.CustomerVisits” Command=”CompanyName.Form.contact.Related.Activities.CustomerVisits.Command” Sequence=”15″ ToolTipTitle=”$LocLabels:CompanyName.Form.contact.Related.Activities.CustomerVisits.LabelText” LabelText=”$LocLabels:CompanyName.Form.contact.Related.Activities.CustomerVisits.LabelText” ToolTipDescription=”$LocLabels:CompanyName.Form.contact.Related.Activities.CustomerVisits.Description” TemplateAlias=”isv” Image32by32=”http://<crm&gt;:5555/PuneCRMTest/WebResources/new_customerVisits” Image16by16=”http://<crm&gt;:5555/PuneCRMTest/WebResources/new_AppAdd” />

</CommandUIDefinition>

</CustomAction>

</CustomActions>

<Templates>

<RibbonTemplates Id=”Mscrm.Templates”></RibbonTemplates>

</Templates>

<CommandDefinitions>

<CommandDefinition Id=”CompanyName.Form.contact.Related.Activities.CustomerVisits.Command”>

<EnableRules />

<DisplayRules />

<Actions>

<Url Address=”http://<crm&gt;:5555/PuneCRMTest/main.aspx?etn=new_customervisit&amp;pagetype=entityrecord” PassParams=”false” WinParams=”0″ />

</Actions>

</CommandDefinition>

</CommandDefinitions>

<RuleDefinitions>

<TabDisplayRules />

<DisplayRules />

<EnableRules />

</RuleDefinitions>

<LocLabels>

<LocLabel Id=”CompanyName.Form.contact.Related.Activities.CustomerVisits.Description”>

<Titles>

<Title languagecode=”1033″ description=”CustomerVisits Description” />

</Titles>

</LocLabel>

<LocLabel Id=”CompanyName.Form.contact.Related.Activities.CustomerVisits.LabelText”>

<Titles>

<Title languagecode=”1033″ description=”CustomerVisits” />

</Titles>

</LocLabel>

</LocLabels>

</RibbonDiffXml>


Step #7 Save the customization.xml file.
Step #8 Zip the all three files (cutomiztion, solution and [Content_Types]) and import into CRM
Step #9 Remove the contact entity from TestSolution.
Step #10 Delete the solution TestSolution.

Import attachment into MS CRM 2011 entity


Let’s say we want to attach some documents in Contact entity records. We can use out of box Import Data Tool to upload data/attachments into MS CRM 2011.To import attachment into particular record we need to identify a unique key for the record(let’s say for contact entity, it’s contact id i.e. GUID or any field which is unique).

Below is the step by step procedure to import attachment for contact’s record.
Steps:
Prepare Source Data:

Step #1 Go to Data Management ->Templates for Data Import -> Select Note and click on Download.
Step #2 Edit the downloaded template as shown below.
https://arvindcsit.files.wordpress.com/2012/07/sampledata.jpg

Description of Columns:
Title: This would be Title of attached file.
File Name: File name of the attachment.
Mime Type: Type of attachment like text/plain.
Regarding:  Reference of record’s field name. In my case I have selected Contact’s Full Name.
Document: Document Id of attached file.
Owner: Owner name must be the CRM user.
Description: Description of file.

Step #3 Build the folder structure for attachments and data file:
Below are some guidelines for file size and folder structure.

If you want to Import multiple files in one Import session, you can .zip them together. A .zip file can include files of .csv, .xml, or .txt file types. All files in a single compressed file must be of the same file type.

The .zip file must confirm to one of these folder structure:

  • .zip file having the files and optional attachment folder directly in it:-
    • Attachments (Folder)
    • <File1>
    • <File2>
    • <File3>

Note: By default, the maximum size of the files you can import is 8 megabytes (MB). This means:

  • Any .csv, .txt, or .xml file must not exceed 8 MB.
  • Any individual file inside the .zip file must not exceed 8 MB and the total size of the .zip file, including the Attachment folder, must not exceed 32 MB.

You can choose any of the above file formats and give it as an input to the Import Data wizard. The delimited .txt, .csv, or XML Spreadsheet 2003 format files can be easily created by using Microsoft Office Excel.

In my case, I followed this “ZIP folder that contain data files and one Attachment folder directly under root” i.e.

  • ContactImport(Zip file name)
    • Attachments(folder)
    • Note.xml

Step #4 Import the ContactImport.zip file using Import Data feature (Data Management ->Imports).
Step #5 Click Next
Step#6 Select “SampleDataMap” and Click Next.
Step#7 Select “Note” for Microsoft Dynamics CRM Record Types and Click Next.
Step#8 Select mapping fields from CRM Fields as shown below and Click Next.
https://arvindcsit.files.wordpress.com/2012/07/fieldsmapping.jpg
Step#8 Clicks on Next.
Step#9 Select Allow Duplicates “No”  and Click Submit.
You can write Data map Name for future import.
Step#9 Data has been submitted for import. It may take time based on size of data.

Step#10 Please check the contact record for attachment.

Custom Get Started Pane for help or video file


Let’s suppose we want to embed a video or html help file for Account entity on Get Started Pane of Account entity.

The default content for the get started pane is located with the Help content. The content is exposed in the application through attributes in the <SubArea> (SiteMap) element for specific entities. This content cannot be included in a solution and, therefore, cannot be transported with a solution.

To create custom get started pane content, the Microsoft Dynamics CRM SDK includes a set of files that replicate the appearance and behavior of the get started pane pages. These files are located at SDK\Resources\GetStartedPaneTemplate.

Below are steps to create custom get started pane.

Steps:

We want to place a custom video and help file on Get Started Pane of Account entity.

Step #1 Import solution “helpvisorcomponents_1_0_0_0” which is available at \sdk\resources\getstartedpanetemplate of CRM 2011 sdk.

Step #2 Create a virtual directory (Let’s say” Video”) on server in ISV folder of CRMWeb
and keep the video file there. Update the below url in helpvisortemplate1.htm file.
URL: http://<CrmServer>:5555/ISV/Video/newCRMjquery_ch9.wmv

Step #3 Edit the “helpvisortemplate.htm” file which is at \sdk\resources\getstartedpanetemplate\helpvisor\1033 of CRM 2011 Sdk and rename the file name as helpvisortemplate1.htm .

Step #4 Create html help file say Help.htm.

Step #5 Create below Web Resources in same solution with similar structure as below

sample_/1033/HelpVisorTemplate1.htm
sample_/1033/Content/Help.htm

Step #6 Add the Site Map to existing solution and export it for editing.

Step #7 Open customization.xml file from exported solution in edit mode.

Replace below code (Usually at 4 places)

<SubArea Id=”nav_accts” DescriptionResourceId=”Account_SubArea_Description” Entity=”account” GetStartedPanePath=”Accounts_Web_User_Visor.html” GetStartedPanePathAdmin=”Accounts_Web_Admin_Visor.html” GetStartedPanePathOutlook=”Accounts_Outlook_User_Visor.html” GetStartedPanePathAdminOutlook=”Accounts_Outlook_Admin_Visor.html” />
With below code
<!–
<SubArea Id=”nav_accts” DescriptionResourceId=”Account_SubArea_Description” Entity=”account” GetStartedPanePath=”Accounts_Web_User_Visor.html” GetStartedPanePathAdmin=”Accounts_Web_Admin_Visor.html” GetStartedPanePathOutlook=”Accounts_Outlook_User_Visor.html” GetStartedPanePathAdminOutlook=”Accounts_Outlook_Admin_Visor.html” />
–>

<SubArea Id=”nav_accts” DescriptionResourceId=”Account_SubArea_Description” Entity=”account” GetStartedPanePath=”$webresource:sample_/redir.htm?data=HelpVisorTemplate1.htm” GetStartedPanePathAdmin=”$webresource:sample_/redir.htm?data=HelpVisorTemplate1.htm” GetStartedPanePathOutlook=”$webresource:sample_/redir.htm?data=HelpVisorTemplate1.htm” GetStartedPanePathAdminOutlook=”$webresource:sample_/redir.htm?data=HelpVisorTemplate1.htm” />

Step #8 Save the customization.xml file
Step #9 Zip all the file with updated customization.xml
Step #10 Import the updated solution and publish all customization.
Step #11 the final output should look like as below.
Step #12 on click of video link; it will play a custom video (not out of box) file in media player and “Help”
link will open html help file.