BCM Import Accounts related to contacts

Status
Not open for further replies.
J

joshbooker

I have a database of Customers with one-to-many relationship to Contacts. Using Import feature of BCM 2007, I'd like to import customers into Accounts and contacts into business contacts while maintaining the relationship. I don't see an account id field when importing business contacts. How you I do this?

TIA,

Josh
 
L

Larry

Hi Josh

The only way this can be done in Business Contact Manager 2007 is to use a script (BCM 2010 allows linking via the GUI). In order for the script to work, the Company Name associated with a Business Contact Must match the Account Name. For example, if you have the following Business Contact:
First Name: John
Last Name: Doe
Company: ACME
Then you must have an Account Named 'ACME'
In order for the Macro to succeed, the Company Name AND the Account Name must match. This includes both Spaces, punctuation marks and Case.
In addition, when Importing Data into the Accounts Folder in Business Contact Manager, you will need to Map the Company Name to the Account Name Field.
What you will need to do is import and map the data into BCM, then run the Macro. I would also recommend importing the data into a test/empty BCM Database.
If you have some programming specific questions, you might want to post them in the Outlook Dev Forum
http://social.msdn.microsoft.com/Forums/en-US/outlookdev
For some general information on Outlook Macros, please take a look at the following link
http://msdn.microsoft.com/en-us/library/ee814736.aspx
Hope this helps!
Larry

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Microsoft provides programming examples for illustration only, without warranty
either expressed or implied, including, but not limited to, the implied warranties
of merchantability and/or fitness for a particular purpose.
This article assumes that you are familiar with the programming language being
demonstrated and the tools used to create and debug procedures. Microsoft support
professionals can help explain the functionality of a particular procedure, but
they will not modify these examples to provide added functionality or construct
procedures to meet your specific needs.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NOTE: Depending on the number of records to be linked, the linking process might
take a substantial period of time.
Sub Link_BusinessContacts()
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim olFolders As Outlook.Folders
Dim bcmRootFolder As Outlook.Folder
Dim bcmAccountsFldr As Outlook.Folder
Dim bcmContactsFldr As Outlook.Folder
Dim newAcct As Outlook.ContactItem
Dim newContact1 As Outlook.ContactItem
Dim userProp As Outlook.UserProperty
Set olApp = CreateObject(" Outlook.Application" )
Set objNS = olApp.GetNamespace(" MAPI" )
Set olFolders = objNS.Session.Folders
Set bcmRootFolder = olFolders(" Business Contact Manager" )
Set bcmAccountsFldr = bcmRootFolder.Folders(" Accounts" )
Set newAcct = bcmAccountsFldr.Items.Add(" IPM.Contact.BCM.Account" )
Set bcmContactsFldr = bcmRootFolder.Folders(" Business Contacts" )
'set the code to continue even if there are errors
On Error Resume Next
'Count the number of Contacts in the Business Contacts Folder
num_contacts = bcmContactsFldr.Items.Count
'Loop through all of the Business Contacts
For i = 1 To num_contacts
'Set the Name of the Company Field (if there is one) to a variable
ContactCompany = bcmContactsFldr.Items.Item(i).CompanyName
'Check to see if there is a Company for the Contact by checking its length
If Len(ContactCompany) > 0 Then
'If there is a Company Name Search to see if there is an Account with that
Name.
'The additional Aprostrophes are required to search for company names
containing punctuation marks and Numbers
Set newAcct = bcmAccountsFldr.Items.Find(" [FileAs] = " & " '" &
ContactCompany & " '" & " " )
'Link the Business Contact to the Account
Set newContact1 = bcmContactsFldr.Items.Item(i)
If Len(newContact1.UserProperties(" Parent Entity EntryID" )) = 0
Then
Set userProp = newContact1.UserProperties.Add(" Parent Entity
EntryID" , olText, False, False)
userProp.Value = newAcct.EntryID
newContact1.Save
End If
Else
End If
Next i
'Let the user now the data has been linked
msgbox " Data Linked Successfully"
End Sub
ADDITIONAL INFO
==================
Business Contact Manager for Outlook Developer Guide
http://msdn.microsoft.com/en-us/library/aa431857.aspx
 
J

joshbooker

Larry, Thanks for your reply.

I understand the process. If I import a new field such as CustomerID, which is present in both Accounts and BusContacts and is also unique then I believe I can eliminate the need for unique Company/AccountName by altering the script to use the new CustomerID field.

Like this:

<snip>

'Loop through all of the Business Contacts
For i = 1 To num_contacts
'Set the CustomerID to a variable
ContactCustomerID = bcmContactsFldr.Items.Item(i).CustomerID

'Check to see if there is a CustomerID for the Contact by checking its length
If Len(ContactCustomerID) > 0 Then
'If there is a CustomerID Search to see if there is an Account with that CustomerID.
'The additional Aprostrophes are required to search for company names
containing punctuation marks and Numbers

'apostrophies may not be required for searching a numeric id

Set newAcct = bcmAccountsFldr.Items.Find(" [CustomerID] = " & " '" &
ContactCustomerID & " '" & " " )
</snip>

Does that sound feasible?

Thanks,

Josh
 
L

Larry

Hi Josh

I have not tried it - but one thing to remember is that - from a design and Interface perspective - BCM and Accounts will only link via the Company Name. Were you trying to link them based on something besides an Account/Company Name?

Larry
 
J

joshbooker

Thanks Larry. I was not aware that the Account Name/Company was used for the relationship in the database & UI. The code looks like there is a required field in BusContacts called 'Parent Entity EntryID' which is being set to the EntryID field of Accounts.

Wouldn't this be the relationship that drives UI?

<snip>

Set userProp = newContact1.UserProperties.Add(" Parent Entity
EntryID" , olText, False, False)
userProp.Value = newAcct.EntryID

</snip>

I tested and am able to have two accounts with same name and relate BusContacts separately to each on the Account Edit Form. This means the account name is not unique and perhaps not a concern for linking(?) Are there other places that the design is to use name fields?

Josh
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
wallisellener Outlook restarting after BCM import BCM (Business Contact Manager) 0
A BCM import email addresses BCM (Business Contact Manager) 3
A BCM 2010 account names import in reverse order BCM (Business Contact Manager) 4
T Import Outlook 2003 .bcm file into Office 2010 Bus. Cont. Mgr. Error: "Input string was not in a cor Using Outlook 6
R Exported BCM file and it saved as .ssb. Now can't import. BCM (Business Contact Manager) 2
B BCM shuts down everytime I try to import/export or check for error BCM (Business Contact Manager) 10
S Import Data from 2003 BCM to 2007 BCM (on Windows 7) BCM (Business Contact Manager) 1
K How to import BCM data to Outlook Contacts? BCM (Business Contact Manager) 1
K Update contacts in BCM via new import BCM (Business Contact Manager) 1
L Help to import a pst file into BCM... BCM (Business Contact Manager) 1
M BCM sbb-file import says: You are not the owner BCM (Business Contact Manager) 4
C Way to import contacts from Excel into BCM Contacts? BCM (Business Contact Manager) 1
P BCM conditional formatting BCM (Business Contact Manager) 5
B Outlook Business Contact Manager with SQL to Excel, User Defined Fields in BCM don't sync in SQL. Can I use VBA code to copy 1 field to another? BCM (Business Contact Manager) 0
D BCM 2013 not functioning as BCM 2010 Example no drop down for communications history Using Outlook 0
J No access to a Database BCM BCM (Business Contact Manager) 3
J Marketing task MS BCM BCM (Business Contact Manager) 10
S BCM Compulsory field, New opportunity Outlook VBA and Custom Forms 0
A BCM does not work anymore! BCM (Business Contact Manager) 1
G Windows Update Causes BCM Database Access Problem? BCM (Business Contact Manager) 4
A BCM does not work with Windows 10 1703 any more BCM (Business Contact Manager) 3
S BCM Auto Backup Data and Customizations BCM (Business Contact Manager) 6
S BCM Project Task Order BCM (Business Contact Manager) 1
T Lost access to remote BCM database BCM (Business Contact Manager) 4
crazyboy Problems connecting to BCM on Server Using Outlook 2
J Problems connecting to BCM BCM (Business Contact Manager) 16
T BCM 2010 randmoly going offline BCM (Business Contact Manager) 0
M At last a BCM alternative... Outlook Customer Mngr 365! BCM (Business Contact Manager) 0
S BCM view customization BCM (Business Contact Manager) 1
L Cannot Connect to BCM database BCM (Business Contact Manager) 9
A Cannot connect to BCM database BCM (Business Contact Manager) 3
K BCM Reports: Timeout Expired BCM (Business Contact Manager) 0
K BCM hide subfolders BCM (Business Contact Manager) 1
Diane Poremsky Restoring BCM Database After Upgrading Windows New Slipstick.com Articles 0
J Unable to link email messages in BCM using a single microsoft office 365 account in outlook 2013 BCM (Business Contact Manager) 1
Diane Poremsky Trial/Beta program for BCM replacement BCM (Business Contact Manager) 8
A BCM crashes immediately after start BCM (Business Contact Manager) 2
A Two Problems with BCM BCM (Business Contact Manager) 0
J BCM 2013 displays wrong form for account and business contact BCM (Business Contact Manager) 1
A Latest updates kill BCM 2013 BCM (Business Contact Manager) 0
C Where are BCM User Customizations located? BCM (Business Contact Manager) 9
Diane Poremsky Outlook 2016: No BCM New Slipstick.com Articles 0
Diane Poremsky Outlook 2016: No BCM BCM (Business Contact Manager) 17
wallisellener BCM and MSSQL2012 BCM (Business Contact Manager) 2
M Can I use BCM projects for this BCM (Business Contact Manager) 1
R BCM Reporting of repeat calendar entries BCM (Business Contact Manager) 0
Eduardo Macias BCM 2013 with SQL Express 2014 BCM (Business Contact Manager) 5
A Upgrade BCM System from 2010 to 2013 BCM (Business Contact Manager) 0
A BCM crashes after Windows 10 update BCM (Business Contact Manager) 1
C BCM Text Boxes & tabs are too short when downloading to Office 365 BCM (Business Contact Manager) 0
Similar threads


















































Top