• Outlook User
  • New Outlook app
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
  • Developer
  • Microsoft 365 Admin
    • Common Problems
    • Microsoft 365
    • Outlook BCM
    • Utilities & Addins

Accessing User-Defined Fields in a BCM2010 SQL Database

Slipstick Systems

› BCM › Accessing User-Defined Fields in a BCM2010 SQL Database

Last reviewed on February 9, 2018     10 Comments

Article by edumas, first posted in our BCM forum

In BCM, custom fields are called user-defined fields (UDF). When a UDF is created, BCM creates entries in several tables to keep track of the new UDF, stores the actual data in binary format and labels the columns UserField# - where # is a number between 1 and 300. In order to access the data stored in a UDF (e.g. for reporting purposes), a user must find the following information:

  1. FieldGUID associated with user-specified FieldName
  2. DataType associated with user-specified FieldName
  3. DataTypeName for the DataType (DataType is same as DataTypeID)
  4. UserFieldIndex associated with FieldGUID
  5. EntityType associated with UserFieldIndex
  6. EntityTypeName for the EntityType (EntityType is same as EntityTypeID)
  7. SQL Database View of the EntityType which also contains the UDFs
  8. SQL Database Views containing information related to the EntityType View
  9. Create SQL Query
    1. Including Joins of related views
    2. Using CAST function to view UDF Binary Data

The best way to explain this process is by example. Let’s assume a UDF has been created for the Opportunity form called Test UDF and is of type Date/Time. Now let’s assume we’d like to query the database for a list of Opportunities including the Opportunity Name, Business Contact Name and Test UDF data. We’ll start by collecting the information specified above.

Step 1: Find the FieldGUID associated with Test UDF (user-specified FieldName)
This is located in the SQL Database Table called UserFieldDefinitions

Step 2: Find the DataType associated with user-specified FieldName
This is also located in the SQL Table called UserFieldDefinitions

Step 3: Find the DataTypeName for the DataType
This is located in the SQL Table called UserFieldDataTypes

Step 4: Find the UserFieldIndex associated with the FieldGUID
This is located in the SQL Database Table called EntityUserFields

Step 5: Find the EntityType associated with UserFieldIndex
This is also located in the SQL Database Table called EntityUserFields

Step 6: Find the EntityTypeName for the EntityType (EntityType is same as EntityTypeID)*
This is located in the SQL Database Table called EntityTypesTable
* Some fields may exist in multiple EntityTypes so you’ll need to refer back to step 4 to find the Field associated with the EntityType of interest.

Step 7: Find the SQL Database View of the EntityType which also contains the UDFs
The SQL Database Views that contain “IMAPIView” in the title are the views that contain all the UDFs. In this example, we want to use the OpportunityIMAPIView.

Step 8: Find the SQL Database Views containing information related to the EntityType View
Since the OpportunityIMAPIView only contains the UDFs, we’ll need to also reference the Opportunity View that contains the core fields as well as the Contact View that contains the core fields. In this example, we’ll need the OpportunityFullView and the ContactFullView.

Step 9: Create the SQL Query (including Joins of related Views)
Using Query Designer in SQL Server Management Studio, the final Query looks like this:

SELECT
OpportunityFullView.OpportunityName,
ContactFullView.FullName,
CAST(OpportunityIMAPIView.UserField7 AS nvarchar(500)) AS Test_UDF
FROM
OpportunityIMAPIView
INNER JOIN
OpportunityFullView ON OpportunityIMAPIView.ContactServiceID = OpportunityFullView.ContactServiceID
INNER JOIN
ContactFullView ON OpportunityFullView.ParentEntryID = ContactFullView.EntryGUID

A few final key points:
1. Step 3 was how the DataType was determined for the CAST function. In this example, UserField7 was CAST as nvarchar since the DataType was “Text”. If it had been of DataType “Date Time”, we would have used CAST as datetime.
2. Finally, from Step 4, we determined from the UserFieldIndex that we wanted UserField7 from the OpportunityIMAPIView View.

Accessing User-Defined Fields in a BCM2010 SQL Database was last modified: February 9th, 2018 by Diane Poremsky

Related Posts:

  • This simple CMDLET will show you which database the users mailbox is i
    See which Exchange database the user is assigned to
  • click in the column to enable
    How to quickly change the values in Outlook fields
  • You can use custom views to display just the data you need. To make it
    How to Create Custom Views
  • Calendar list view
    Create a view for appointments that don't have reminders

About Diane Poremsky

A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Subscribe
Notify of
10 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Ralf (@guest_210470)
February 27, 2018 5:56 am
#210470

Hi There,

we migrated from BCM2010 to BCM2013 - better to say we tried...
The update tool didn't work, so we deleted everything manually and installed office 2013 and BCM 2013. We also migrated all data "by hand" with some SQL scripts and nearly everything is looking good.

But we have the following problems:
- UDF are visible on the masks but the content is missing. In the database the userfield table is filled
- When we like to filter some tabs or views or matkeitng activities, the UDFs are not visibile.

I think we misses any connection of the UDFs by migrating our data, but I don't know where...
When I try with the statements above everything is looking fine...

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Ralf
February 27, 2018 4:51 pm
#210478

How did you update (the failed one) ? Did you get any error messages? I think the solution will be to fix the upgrade - it sounds like the scripts are missing something.

0
0
Reply
Lorinda (@guest_197766)
April 11, 2016 5:35 pm
#197766

Hi Diane,

Do you know if you are able to create a report and pull info from fields in both "Opportunities" and in "Business Contacts"?

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Lorinda
June 15, 2016 11:57 pm
#199427

It's been a long time since I used BCM (since it doesn't work with outlook 2016) but if BCM reports can't do it, you might be able to do it using a VBA macro in Outlook.

0
0
Reply
BarryM (@guest_190073)
March 30, 2015 6:01 am
#190073

Another problem in BCM.
Randomly contacts are deleting without any action from the user. Several times I have to set them back from the deleted items. Does anyone have experience with that -and even better- the solution for that?
Maybe it's connected to my problems above, so that's why I leave it as a comment instead of opening a new post.

0
0
Reply
BarryM (@guest_190072)
March 30, 2015 5:46 am
#190072

Thanks for your reply.

1) In the mean while, i've asked a friend to copy the numbers to a UDF markup as text. It's probably a floating point / SmallInt problem. Do you not experiance that problem?

2) I'm syncing the contacts with the utility in Outlook BCM. The button in Synchronising (I've the Dutch version so cannot talk you trough the menu's). The contacts are being synchronised, but the accounts aren't. I want to see the accounts also on my phone.

PS. Now i see another problem. The contacts are indeed beeing synchronised to my (Android) phone (as mentioned before). They (also) appear on My Contacts in Outlook. But they are multiplying. A lot of the contacts are multiple times mentioned and they come out of BCM. I know that they are comming form BCM because I've made a category for the contacts wich are comming from BCM (and differs from other existing contacts). So a contact appears several times in MyContacts and on my mobile. In a few days 200 contacts are 2600 contacts...

0
0
Reply
BarryM (@guest_189439)
February 20, 2015 4:03 am
#189439

Hello Diane,
I'm reading your post with interest. Thanks for that!

I'm from the Netherlands and using BCM in outlook 2013 in a server environment. Besides a lot of problems in translations en typical differences in country (for example the adresses), the real question:
I've made a User Defined Field in Accounts to enter the Chamber of Commerce number in the Accounts "KvK-nummer", type number shortened. But when I enter- for example the number 57721149, BCM displays and saves 57721148 (Notice the last number). It does so whit a lot of numbers.
Strangely the import (from another CRM) is saved correctly.
57.721.146 turns BCM into 57.721.144
57.721.147 turns BCM into 57.721.148
57.721.148 stays 57.721.148

Do you know what the cause is, and even better, how to solve it?
Thanks,
Barry

PS besides and off topic, but maybe you know this: We already synced our business contacts with android, thats great. But how also to synchronise the accounts with android?

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  BarryM
March 21, 2015 1:18 am
#189967

I have no idea why BCM is changing the numbers.

How are you syncing the contacts? If the accounts sync to outlook's contact folder, they will sync to the phone.

0
0
Reply
richtemen (@guest_188963)
January 30, 2015 2:21 pm
#188963

Hi, Diane. This page helped me a lot to learn how to find my user defined fields.
Do you have an article like this one to UPDATE my user defined field?
Here is the query I made to find my field in question:
SELECT
LastName,
CAST(ContactIMAPIView.UserField15 AS DateTime) AS [Last Activity]
FROM [MSSmallBusiness].[dbo].ContactIMAPIView
INNER JOIN
[MSSmallBusiness].[dbo].ContactFullView ON [MSSmallBusiness].[dbo].ContactIMAPIView.ContactServiceID =
[MSSmallBusiness].[dbo].ContactFullView.ContactServiceID
where email1address = 'kerry.j.preete@monsanto.com'

Now I want to change this to an update query in my Outlook VBA program.
Can you direct me to an appropriate article for showing me how to code the update?
Or if you already have a code snippet, that would help as well.

Thanks,
Rich

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  richtemen
February 10, 2015 12:51 am
#189223

I definitely don't have any code samples. Did you try the regular SQL update statment - "update table set fields where fields = whatever" ?

0
0
Reply

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 30 Issue 15

Subscribe to Exchange Messaging Outlook






Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • Week Month All
  • Use Classic Outlook, not New Outlook
  • How to Remove the Primary Account from Outlook
  • Disable "Always ask before opening" Dialog
  • Adjusting Outlook's Zoom Setting in Email
  • This operation has been cancelled due to restrictions
  • Remove a password from an Outlook *.pst File
  • Reset the New Outlook Profile
  • Maximum number of Exchange accounts in an Outlook profile
  • Save Attachments to the Hard Drive
  • How to Hide or Delete Outlook's Default Folders
  • Google Workspace and Outlook with POP Mail
  • Import EML Files into New Outlook
  • Opening PST files in New Outlook
  • New Outlook: Show To, CC, BCC in Replies
  • Insert Word Document into Email using VBA
  • Delete Empty Folders using PowerShell
  • Warn Before Deleting a Contact
  • Classic Outlook is NOT Going Away in 2026
  • Use PowerShell to Delete Attachments
  • Remove RE:, FWD:, and Other Prefixes from Subject Line
Ajax spinner

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in classic Outlook (Windows).

For new Outlook for Windows: Fixes or workarounds for recent issues in new Outlook for Windows .

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Outlook.com Recent issues: Fixes or workarounds for recent issues on Outlook.com

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Outlook (new) Feedback. Use this for feedback and suggestions for Outlook (new).

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




New Outlook Articles

Google Workspace and Outlook with POP Mail

Import EML Files into New Outlook

Opening PST files in New Outlook

New Outlook: Show To, CC, BCC in Replies

Insert Word Document into Email using VBA

Delete Empty Folders using PowerShell

Warn Before Deleting a Contact

Classic Outlook is NOT Going Away in 2026

Use PowerShell to Delete Attachments

Remove RE:, FWD:, and Other Prefixes from Subject Line

Newest Code Samples

Insert Word Document into Email using VBA

Warn Before Deleting a Contact

Use PowerShell to Delete Attachments

Remove RE:, FWD:, and Other Prefixes from Subject Line

Change the Mailing Address Using PowerShell

Categorize @Mentioned Messages

Send an Email When You Open Outlook

Delete Old Calendar Events using VBA

Use PowerShell or VBA to get Outlook folder creation date

Rename Outlook Attachments

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Diane Poremsky [Outlook MVP]

Make a donation

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Submit Outlook Feature Requests

Slipstick Support Services

Buy Microsoft 365 Office Software and Services

Visit Slipstick Forums.

What's New at Slipstick.com

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2025 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment