Creating a Bing Map URL with a Business Rule

Published Mar 25 2019 02:35 PM 70 Views
Not applicable
First published on MSDN on Feb 19, 2010

(this post was contributed by Brian Barnett, Senior Software Engineer on the MDS Team)

While using Bing Maps last night to look for directions I thought of a way to use MDS business rules to create a Bing Map URL link attribute. This may sound like merely a cool thing to try but not very useful. But, I’m going to show a couple of examples of how it could be useful to pique your interest for other possibilities.

Here is the URL format we will need to follow to open Bing Maps to a specific address: 1 %20 Microsoft %20 Way %20 Redmond %20 WA %20 98052

For more info see the Bing Maps help topic Build your own URL .

I’m going to use the Customer sample model. We’ll need to add a link attribute to the customer entity then create a concatenation business rule to set the value of the link attribute. In this post I’m not giving the step-by-step, detailed instructions to create each item. Please see my Creating a Simple Business Rule and Enabling Human Workflow – Part 1 posts for specific instructions.

Add the link URL attribute

Add a new Free-form, link attribute to the Customer entity called BingMapURL .  Make sure the data type is Link .

Create the business rule

Now let’s create a rule to populate its value.

  1. Create a new rule and then navigate to the Business Rules Designer page.
  2. In the Components pane, expand the Actions and Change value nodes.
  3. Click the “ equals a concatenated value ” action and drag it to the THEN pane's Action label.
  4. In the Entity-Specific Attributes pane, click the BingMapURL attribute and drag it to the Edit Action pane's Select attribute label.
  5. In the Entity-Specific Attributes pane, click and drag the following attributes to the “Value” node of the “ equals a concatenated value ” action.
    1. AddressLine1
    2. City
    3. StateProvince
    4. PostalCode
  6. At this point your Edit Action should look like this

Now let’s add the Bing Map specific URL pieces.

  1. Right click on AddressLine1 attribute and select “ Insert text” from the context menu.
  2. Double click the new line and enter this text, without the quotes, “ ”.
  3. Right click on the City attribute and select “Insert text” from the context menu.
  4. Double click the new line and enter this text, without the quotes, “ %20 ”.
  5. Repeat steps 8 and 9 for the StateProvince and PostalCode attributes.
  6. Now your Edit Action should look like this.

  1. In the Edit Action pane, click Save. The action will be displayed.

  1. Click Back to return to the Business Rule Maintenance page.
  2. Optionally, on the Business Rules Maintenance page, for the row that contains your business rule, double-click a cell in the Name and Description columns to update the value.
  3. Click Publish Business Rules
  4. On the confirmation dialog box, click OK . The rule’s status will change to Active .

Try it out

Add a new customer then return to the Member grid. Scroll over to the right and you will see the populated BingMapURL.

Double click the link icon and then select View from the context menu.

A new browser window opens to the Bing Maps URL.

To prevent users from editing the BingMapURL attribute change the security permissions to Readonly. Other possibilities are to create another link attribute called BingMapDirectionsURL which would be the URL for directions from your company to the customer.

Here’s another example, which I’ll not walk through but simply give you as an idea. What if you have an internal (or external) product catalog website? If you are managing Product data in MDS then you can add a ProductCatalogURL link attribute to the Product entity then follow the same steps we did with the BingMapURL to create it.

If you want to take this a little further you could create an ASP.Net web application that utilizes the MDS API. You could create a product list page listing all the products. Each product listing would have a link to the product catalog using the ProductCatalogURL.

There are a lot of possibilities. All it takes is a little creativity.

Version history
Last update:
‎Mar 25 2019 02:35 PM
Updated by: