CRM Rules
  • CRM Rules
    • CRM Rules Overview
    • CRM Rules Technical
    • Why CRM Rules?
    • What’s in Each Version
    • CRM Rules Brochures & Documentation
    • Comparison to Microsoft CRM 2013 Business Rules/PBL
    • Examples of CRM Rules
    • Videos
    • Where to Find CRM Rules
    • FAQs
  • VARs/Partners
    • VAR Developers License
    • VAR Partner Program
    • VAR FAQs
  • Pricing
    • Pricing page
    • Buy CRM Rules Today
  • Blog
  • Contact
0

How to Map Account Address into Contact

29 October, 2014 - Blog, CRM General Info

Most people understand how to map account address information to a contact using the Map features of CRM. It is very powerful and easy to configure and implement. But what happens when the contact switches companies? The user then has to manually update the contacts address to match the accounts! Not to mention any other fields which you have on the contact that are derived from the account. Out of the box that’s as many as 77 fields!

With CRM Rules, having the JavaScript do this automatically is a breeze.

Step 1: Get CRM Rules ready

Assuming you have installed the product, make sure you have create/updated the metadata for both contact and account. Go to Settings: Entities, open up Contact from the grid, and hit the Create/Update button.

blog accounts1

Do the same for Account if you haven’t already.

Make sure everything finishes by looking in the Deployment History Grid

blog accounts2

Step 2: Create your Rule

Even though this is a highly complex rule, it can all be created using our Simple Rule form.

Even though we are copying the account fields, it happens on the contact form.

Then we can find the pre-created condition of the Parent Customer Changed.
blog accounts3

We come back and look like this:

blog accounts4

We have to hit the New button after we hit the lookup button since this action can’t be one of the ones we create automatically.

blog accounts5

The rule action is a copy field(s) from lookup entity action. Notice the fields that are added once we select that action type. Also notice the field on the right that says Generate Copy Records for All fields. A word of caution – the system matches by attribute name – and account and contact have a tremendous amount of fields with the same name! This may result in more fields than you actually want to map, so you will have to perform some cleanup after. The mapping occurs after you hit the Save button when a plugin we have runs. In my system, this automatic mapping resulted in 80 fields being mapped! That is a LOT OF FIELDS!! You might ask, what happens if the code maps a field that isn’t on my form? No worries, we make sure the field is on the form before we try to copy it, ensuring that we won’t cause any errors.

blog accounts6

Deleting is a lot easier than creating, so I ended up deleting about 40 of them, and just mapped my address fields.

blog accounts7

Hit save and Close and OK, and you will find yourself back on the simple form.

blog accounts8

Mapping these fields every time you open the form may not make sense, so we will uncheck that box. Then hit validate – the rule should say Ready to Deploy after a moment.

blog accounts9

Hit Deploy – and give it a minute….refresh the grid and it will save “Deployed”

blog accounts10

Open a contact, change the parent account and watch it work!

The Gory Details…

In case you are interested in what you just did, CRM Rules doesn’t try to hide anything like the Business Rules that you can do with 2013. Open the same rule and switch the form to the Advanced Form. Then select the Generated Code tab. You will see 135 lines of highly complex code, inside of 4 methods, that you didn’t have to figure out how to write, nor pay someone to figure it out.

This is why we love CRM Rules!

Comments are closed.

Contact us for a quote

News & Events

  • Press Releases
  • Upcoming Tradeshows
  • Upcoming Webinars

Company Info

  • About us
  • Where to find CRM Rules!
  • Partner Program
  • Site Map
  • Contact Us

Resources

  • Videos
  • Brochures
  • Our Blog
  • Microsoft Dynamics Marketplace

From our Blog

  • Welcome
  • Latest postings
Twitter Facebook

© 2013 crm-rules.com.