Friday, May 18, 2012

Add a "Copy Address to Clipboard" Button to Your Contact Form

Posted in [Dynamics CRM], [Technical] By Matt Wittemann @ 6/12/2008 12:06 PM

 

 

<Entity name="contact">
   <MenuBar>
            <!-- Custom Menus that you may add -->
            <CustomMenus />
          </MenuBar>
<ToolBar ValidForCreate="1" ValidForUpdate="1">
            <Button JavaScript="var texttocopy;
var AddrL2;
if(!IsNull(crmForm.all.address1_line2.DataValue))
{
AddrL2 = ' ' + crmForm.all.address1_line2.DataValue + '\n';
}
else
{
AddrL2 = '

';
}
try
{
texttocopy = crmForm.all.firstname.DataValue + ' ';
texttocopy += crmForm.all.lastname.DataValue + '\n';
texttocopy += crmForm.all.jobtitle.DataValue + '\n';
texttocopy +=

crmForm.all.parentcustomerid.DataValue[0].name + '\n';texttocopy += crmForm.all.address1_line1.DataValue + '\n';
texttocopy += AddrL2;texttocopy += crmForm.all.address1_city.DataValue

+ ', ' + crmForm.all.address1_stateorprovince.DataValue + '  '  + crmForm.all.address1_postalcode.DataValue + '\n';window.clipboardData.setData('Text',texttocopy);alert('Address

Copied to Clipboard');}catch(e){alert('Error');}">
              <Titles>
                <Title LCID="1033" Text="Copy Address" />
              </Titles>
              <ToolTips>
                <ToolTip LCID="1033" Text="Copy Address to Clipboard" />
              </ToolTips>
            </Button>
          </ToolBar>
        </Entity>


4. Import the ISVConfig.xml file back into CRM.

5. Refresh your CRM in the browser, open a Contact record, and test your button out.

Happy copying and pasting!

Tip: You may need to go to the Settings > Administration > System Settings > Customizations tab in CRM 4.0 to indicate that you want the ISVConfig customizations to show in the web and/or Outlook clients. In 3.0 you need to edit a config file on the CRM server (more info about this is in the SDK).

When working with Contact records in Microsoft Dynamics CRM, you might find it frustrating if someone asks you to send them the address of a particular contact. You either have to re-type it or copy it line by line. To save yourself the headache, use the ISVConfig customizations in CRM 3.0 or CRM 4.0 to add a button to the Contact form that lets you copy the address to the clipboard. The example below illustrates how to do this for the Contact.

1. In the CRM Customizations area, go to "Export Customizations"

2. Export the ISVConfig.xml file and save this file. Make a copy for backup.

3. Edit the XML in Notepad or Visual Studio. Place the following code between the <Entities></Entities> tags:


Popular tags: ,

Comments

Got something to say? Join the discussion »
    Posted by Matt Wittemann on 5/9/2011 10:01 AM
    Great suggestion, Doug! I'll work on it!
    Posted by dsteinschneider on 5/9/2011 9:44 AM
    Hi Matt,

    I'm thinking of adding a copy to clipboard button for CRM 2011. I've saved a bunch of links to tutorials on how to build CRM 2011 Ribbon buttons but been so busy migrating my GoldMine customer base that I haven't had time to master buttons. I know what you've posted here will dovetail in so I'm suggesting in one of your free moments :) that you consider an update this page.

    Your faithful reader,

    Doug Steinschneider
    DCS Group
    Fairfield, CT

leave a reply

 [Quick Submit with Ctrl+Enter]

Remember my details
Notify me of followup comments via e-mail

C5_Insight

About C5 Insight

We are a Microsoft Gold Certified partner focusing on SharePoint, Microsoft Dynamics CRM and Salesforce.com.  Learn more about us by visiting our website.

Search

We Wrote the Bible on Microsoft SharePoint and Dynamics CRMBook-Microsoft Dynamics CRM 2011 and SharePoint 2010 Bible

Tags

Maximize

Recent Comments

Maximize

Blog Roll

Maximize

Disclaimer

The information herein may be used solely at your own risk.  No warranty is made by the author or by C5 Insight, Inc.

The opinons expressed herein are those of the individual authors and do not necessarily represent C5 Insight, Inc in any way.

Copyright 2011 by C5 Insight