Microsoft Dynamics CRM Customization: Copy Address Dialog

Here's another in a series of Microsoft Dynamics CRM customization walkthroughs.

CRM Customization: How to copy an entire address

Copying an address from an account record in Dynamics CRM can be a little bit tricky. If you click in the address box itself, then highlighting the address opens the address editor and de-selects the address text:

Microsoft CRM 2015 address

However, with a little quick web development, we can add a web resource to a make it much easier to copy the address. First, create a web resource called AddressCopyButton.html and upload it as a new web resource. The web resource should have the following code:

<!DOCTYPE html>
<html xmlns="">
<style type="text/css">
body, html {
input[type="button"] {
function OpenCopyAddressDialog() {
var fieldAddress = parent.Xrm.Page.getAttribute('address1_composite');
//check if field1 is on form
if (fieldAddress === null || fieldAddress === 'undefined') {
alert('address1_composite' + ' is missing from form!')
//get values
fieldAddressValue = fieldAddress.getValue().replace(/(?:\r\n|\r|\n)/g, '<br />');
return false;
parent.$(function () {
// append the jQuery dialog cascading stylesheet to the main form so that the dialog will look ok
parent.$('head').append("<link rel='stylesheet' href='//'>");
parent.$('head').append('<style type="text/css">.CopyAddress .ui-dialog-titlebar { margin-top:0px; margin-bottom:0px; }<style>');
// add the div to the page
parent.$('body').append("<div id='CopyAddressDiv' title='Copy The Address' style='background-color:#eee; text-align:center;'></div>");
title: "Copy Address From Here",
height: 200,
width: 350,
autoOpen: false,
dialogClass: 'CopyAddress'
<input type="button" value="Copy Address" onclick="OpenCopyAddressDialog();" />

Then, edit your form and insert a web resource below your address block with the source set to the web resource you just uploaded.

This makes use of jQuery and jQuery UI already built into Dynamics CRM 2015 (you can add the necessary references for previous versions of CRM) to show a simple dialog to make it easy to copy the address. For more CRM customization examples, click here.

microsoft dynamics CRM customization 2015 screenshot copy address

InterDyn Artis is the Carolinas leading provider of CRM and ERP solutions. Our team of experts provide implementation and consulting services to businesses throughout the Carolinas. If you have a CRM customization request, you may contact us at (704) 846-6750 or by sending our team an email at [email protected].

Show Buttons
Hide Buttons