How to import history in Dynamics? - dynamics-crm

We currently have a system that have contacts in it. It will be mapped to the contact entity in Dynamics. Each of the contacts have an address history (Yes, some of them moved in the last 20 years).
We are soon to import the old system in Dynamics, and I am wondering how can I import a contact address history. Let assume I have user 'John' :
| Name | Address | LivedThereFrom | LivedThereTo |
-----------------------------------------------------
| John | 123 X road | 2005 | 2008 |
| John | 123 Y road | 2008 | 2010 |
| John | 123 Z road | 2010 | | ==> Current address
So I will import 'John', then (with audit activated on addresses) import his address from 2005 to 2008, then update it's adresse to '123 Y road', then finally update it to '123 Z road' to have the full history available in Audit.
The problem is the following : How can I 'tag' those adresse from 2005 to 2008, 2008 to 2010 and then 'current'... I thought of using the 'created_on' field in the Audit table to help me, but there seems to be no way to modify that data (except going directly in the database and lose Microsoft's support on the product).
Thanks

If the client insists on through the product, then then another option is to import the addresses multiple times.
Setup
a) Turn on Auditing for the entity.
b) Add a new field to store the Date in which the Address was first used (Address Commencement Date)
Import
a) Import all Customer's oldest addresses first, set the Address Commenecement Date to the LivedThereFrom date
b) Export the addresses and make it available for re-importing.
c) Update the valyues in the spreadsheets based on the next available LivedThereFrom for that Customer. Hint: Convert the exported spreadsheet to XLSX first. Use formulas to work out which ones to replace.(e.g. VLOOKUP) If really large spreadsheet then may need to split to enable re-importing under 5MB limit. Could use ROW_NUMBER function in SQL to get a list of next addresses to update from your source system.
d) Continue doing c) until all records are loaded
In the Audit history you will see the the date which the new Address became active with the Address Commencement Date.
If they don't mind the direct database approach I'd go straight for the audit tables
Good luck.

One way that doesn't involve changing the way Dynamics handles contact addresses or doing any unsupported stuff is to make a custom entity the job of which is to store all of your contact's address history. It could contain the address, the dates between which that contact lived there, and (importantly) an N:1 or N:N relationship between your new address entity (say new_Address) and the Contact entity that links the two together.
A drawback is once this is done, you probably would have to introduce some business logic to sync the contact's address records to this new entity, which is certainly possible within Dynamics, and perhaps at some level, unavoidable.

Related

Automatically assign records after 1 day in MS Dynamics CRM

I would like to implement a functionality in MS CRM-
When a user changes a department, record owned by him should be automatically assigned to department owner after 1 day. How to achieve this functionality in Microsoft Dynamics CRM ? By some plugin or workflow ?
Assuming you have some type of lookup for Department (1:1 relationship with SystemUser, I would use Power Automate to solve this.
Put the flow on the system user entity, filtered for when column Department changes. When that happens, use Dataverse connector and pull owner of previous Department, re-assign existing records for types (tables) x, y, z.

Add record to MS Access table fails - wrong auto id value

I need to add records to a table which has a unique id field. Up until recently I did this via a query but find today it doesn't work.
I tried manually copying a record and I tried manually inputting a new record. In both cases Access created a record with id=1306 but the next id would have been 1899. Consequently there was an error msg = The changes you made were not successful because they would create duplicate id...
Every time I go through this process the trial id clocks on 1 and is now 1309.
I am prevented from editing this manually. The table is related to many other tables and vice versa.
Any ideas please.
The table was created under Access 2003 or earlier. The edition running now is 2013.
Thanks - Stewart.
Fixed by running Repair & Compact.
Wrong/duplicate generated Autonumbers are a sign that something is broken in the database.
Further reading:
Allen Browne: Fixing AutoNumbers when Access assigns negatives or duplicates

Massively updating fields from Excel

A common way to massively update fields of entities is to use the export/import functionality of Dynamics CRM:
You can use the AdvancedFiend feature to select records of interest.
Export them via the Export feature to Excel (enabling the option "Make this data available for re-importing by including required column headings").
Update cells in the Excel sheet.
Import that sheet once again with the Import feature of Dynamics CRM.
Now I have an Excel sheet with columns (fields) and rows (records) which holds data of the entity "contact" - but this sheet does not come from Dynamics CRM, but was manually created. The header could look like:
| contactid | firstname | lastname | birthdate | fax |
As you can see I have the contactid (the primary key) of a contact and its related fields. All the contacts in the sheet already exist in the CRM and need to be updated.
QUESTION:
How can I update the CRM with the data of my Excel sheet WITHOUT writing an individual tool, but by using the standard functionality of CRM (Import, Workflows etc.)?
Once again: The sheet was not exported from the CRM before.
With best regards,
Michael
A very similar question was asked the other day in this thread on the Dynamics Community forums , and answered in some detail:
https://community.dynamics.com/crm/f/117/t/182988
tl;dr: Create a custom entity with a lookup to Contact, import your date to that and use a Workflow to copy the relevant fields to the Contact records.
Or export all Contacts for reimport (with the columns that you need to update), populate the data of the records you need to change and reimport. Any unchanged rows will be dropped by the import process.
Unfortunately, the import process in CRM requires you to meet the standard format specified by the process. So you can either manually transform the excel sheet to meet the standard, write a tool to do it, or search for a tool that had already been written.

Isolate the state abbreviation of and address

Is there a way to pull out the state abbreviation from an address? I am using an event calendar extension for Joomla for my site and it currently only stores the city and county separately in the database but it does give the address all together, ie. 123 Main St., Townsville, ID 55555. Is there a way to grab the two letters of the state and spit that out instead? Even if there might be a way to grab all of the two letter occurrences and then compare those to a list of state abbreviations to validate.
Thanks
Jason
The problem with extracting the information the way you're asking to is that some people might enter the entire State name, some might abbreviate the state, some might misspell the state... etc.
You can't count on people to give you the right data... it's just a fact of programming.
You could extend the database and form to include the State separately... going further, you could use a predetermined Ajax AutoComplete extension or a Dropdown List in order to ensure the user is selecting the correct State.
In my apps, I enter all of the US States and all of the Canadian Provinces in a Region table. Then in the Person table, I have an int State. That way I can join the person's state to the region table and save valuable db space. But that's just me.
dbo.Person
| ID | Name | Address | Zip | StateID | etc... |
dbo.Region
| ID | ParentID | Name |

Problem with importing Quote Products in CRM 2011

Hi I am having a problem with importing Quote products in CRM 2011.
When I downloaded the template for import, the columns require that I state whether the product is a 'Write-in' or an 'Existing' product. Then there are an additional 2 columns: Write In, Existing.
On filling in the template with sample data for import, I wrote something like this:
Write-in | | New product |......
Existing | Existing Product 1 | |.......
(The | is a new column )
I am assuming that when the product is a write-in product, you must enter a new product and when the product is an existing product, you write the name of an existing product in the system. The other columns are then left blank.
However, I am getting errors on import and I have no clue why :/ I am giving it the wrong data?
Also... the company does not make use of a Product List. Is there a way in which I can bypass its use since every time I enter a new product, I am asked to give the price list and this is not viable for the company since there are hundreds of products and the items and their prices change constantly so we cannot make use of a Product List especially when I am asked to enter a New Product List every time :/
Does anyone have a clue of what can be done? Thanks :)
IMHO, I can suggest the following.
Have a default price list, Onload of such forms, autofill that field with that PriceList.
Also, when quote is created, use JScript to say there is always going to be a write In product. (Then, you dont require the Product Lookup filled in).
Also, I dont know what kind of errors you get here, but when you specify an existing product, you also have to specify the UniOfMeasure or something. Make sure you have one supplied in your CSV.

Resources