Microsoft Dynamics Data Import Failing with Unresolved Lookup - csv

I'm attempting to import a csv file in Microsoft Dynamics 2011. The file is an export of sales data from our website and I'm attempting to create new Account, Contact, Invoice, Order, Invoice Product and Order Product entities using this data. I'm using a multi-entity data map to do this.
When I attempt the import however, creating the invoice fails with the message "The lookup reference could not be resolved." in connection with the currency field. This field is a lookup tied to currency name which in all cases is "US Dollar". This is exactly the same name as the USD currency in our database, but for some reason the lookup refuses to assign it correctly. There are no other currencies in our database with this name.
Can anyone offer me an explanation as to why this is happening and any steps I can take to deal with it? Many thanks.
EDIT: More information about my problem.
It seems that problems occur when I try and perform a multiple entity import with duplicates. All the new entries I'm creating from this import is dependent on other new entries created with the same data. I'm creating accounts, then creating customers to assign to those accounts for example. If said accounts have duplicates already in the system, they are ignored. This is expected. However, when it comes to create the customer assigned to that account, the lookup fails with a "Duplicate lookup reference was found" error. This error occurs when there are more than one things in the database that fit the value I'm using with the lookup.
I'm not 100% sure, but I think it's counting both the account that was ignored and the original account that's already in the system when performing the lookup. Can anyone offer more insight on how I might work around this?

I don't know for sure if this is your issue but my guess it is.
In the import wizard you can select how he resolves your lookups.
i.e: when in your CSV file the column contains the name of the currency you will have to select the name field in your import wizard for the currency field.
In the screen here you can see then country is a lookup and the name of the country is the value of CSV file. It must match the field of the lookup. If I select "created on" It doesnt find the lookup. because no country exists where created on equals "Belgium". So you select the Name field of the lookup and that is how he will check your value in the CSV in the lookup field you defined.
1.Put records for each record type in a separate file.
2.Put records for different owners in a separate file.
3.Ensure that the first line of the file contains column headers and that they match the CRM attribute display names EXACTLY if you would like the import wizard to automatically* map the data. *Automatic mapping is required if you intend to import records that are related to another record (See #6). I HIGHLY RECOMMEND USING AUTOMATIC MAPPING EVEN IF YOU DO NOT DESIRE RELATED RECORDS.
4.Make sure the first column heading is not the name of a record type.
5.Make sure data exists in your source file for all CRM required fields (denoted with a red asterisk on the CRM form).
6.Make sure some data exists for each column. If a column has no data delete the column.
7.If your data should be related to another record (i.e. Adding Contacts to existing Accounts) make sure the column header matched the CRM lookup attribute display name. If you have two different attributes in CRM with the same display name you will receive an error (EX. if you created a custom State picklist value to replace the text version and keep the display name the same "Address 1: State/Province"). Also make sure the company name values will match a corresponding account record (i.e. contacts with a Parent Customer value of Microsoft Corp. will not be added to the CRM Account Microsoft) and that there are no duplicate Accounts in the system as the import will not be able to resolve the proper Parent Customer.
8.If you are importing into a drop-down list, ensure all the values exist within CRM and there are no typographic errors and consistent capitalization in the source file.
EDIT: It seems like indeed there are multiple records in your DB that can fit in that 1 lookup. it's normal that he gives an error on this as he can't resolve the lookup. The CRM doesn't know which record to take.
Also you might want to watch out if you are importing a M-N Relationship. You will have to do a M-N Relationship with code. The standard import wizard cannot handle Many-to-many relationships

Related

Lookup Fields MS Access

I am somewhat new to MS Access and I have inherited an application with a table that uses this Lookup feature to replace a code with a value from a query to another table.
When I first used this table and exported it to Excel for analysis, I somehow got the base ID number (or whatever it would be called) rather than the translated lookup value. Now, when I do this, I get the translated text. The biggest problem is that while the base value is unique, the translated values are not, so I cannot use them for the work I am doing.
Can someone explain how to get the underlying ID value rather than the lookup value? Is there some setting I can use or some way to reference the field upon which the lookup is based. When I query the ID field, I get the lookup value. I know that the first time I did this, the spreadsheet contained the ID number not the text.
For now, I created a copy of the table and removed the lookup information from this copy, but I know I did not run into this when I did this the first time.
Thanks.
When you export to Excel, leave Export data with formatting and layout unchecked. This will create a spreadsheet with raw data values in Lookup fields.
Export settings image

SSIS CRM11 upsert record

Can anyone help me for upserting the record in CRM11 using kingswaysoft crm connector ?
I have an excel sheet which contains employee number and other details, not any guid. I need to insert or update these data in CRM11.
Do we need guid to update the record. Can we not proceed for update without guid I mean based on employee number ? If yes then how to fetch the guid using employee number through CRM connector ?
Here need DEPARTMENT entity detail based on their name provided in excel sheet, basically need to LOOKUP. Is it possible to fetch other entities details like department through CRM connector instead of directly pointing to the sql database ?
We (I work for KingswaySoft) support manually specified fields to be used for Upsert operation. It is a relatively simple configuration. You basically choose Upsert as the action on the general page of the CRM destination component, then "Manually Specify" as the Upsert/Update matching criteria. After that, you would head to the Columns page to select the matching fields which become the Upsert key fields. In the case that you set up this type of manually Upsert, you don't need to worry about GUID (and you should not map the primary key field just to be safe). When the Upsert action happens, we actually first do a lookup of the key values based on the matching fields that you have selected, it would create a new record if no match is found and our component will return the newly created record's ID in the default output. If a match is found, we use the GUID value from the lookup operation to perform an Update.
If you have to perform the Upsert based on a field from a lookup (or related) entity, you would have to go a different approach (as suggested by our team above), you would be using an SSIS Merge Join component. The idea is, you use a CRM source component to read from CRM. The source component would be using a FetchXML query that reads from the target entity by joining with the lookup (or related) entity that you want to pull the key values. After the merge join component, you would know whether a match is found. If a match is not found, then you would send to a destination component to perform a Create action. Otherwise, if a match is found, you would send it to a destination component that performs the Update action. The merge join component would be doing a left join.
Hope this helps. Please feel free to let me know if there is anything else that we can help with.
have you taken a look at our Help Manual? You can find instructions for how to use our destination component to write data to a destination Microsoft Dynamics CRM server.
Our CRM destination component supports Upsert action, which would update any existing records in CRM if matching can be found, otherwise create a new record.
There are four matching options supported when the Update/Upsert action is selected: Primary Key, CRM Duplicate Detection, Manually Specify, Alternate Key.
You can use Manually Specify matching criteria if you do not know the GUID value and would like to perform Update/Upsert based on the employee number.
Our CRM toolkit uses CRM Web Services to communicate with CRM, we do not work directly with your SQL database.
To perform LookUp based on the name in Excel, you can use SSIS Merge component to find the Department details of the records in your excel sheet.
Hope this has helped, feel free to reach out to us if you have more questions.
Upsert doesn't exist in CRM 2011 so you'll need to do it manually in two operations:
Retrieve based on Employee number, then
If exists => Update, otherwise, Create

SSIS - Reuse Ole DB source when matching Fact against lookup table twice

I am pretty new to SSIS and BI in general, so first of all sorry if this is a newbie question.
I have my source data for the fact table in a csv, so I want to match the ids against the surrogate keys in lookup tables.
The data structure in the csv is like this
... userId, OriginStationId, DestinyStationId,..
What I am trying to accomplish is to match the data against my lookup table. So what I am doing is
Reading Lookup data using OLE DB Source
Reading my csv file
Sorting both inputs by the same field
Doing a left join by Id, in order to get the SK
This way, if there is no match (aka can't find the surrogate key) I can redirect that to a rejected csv and handle it later.
something like this:
(sorry for the spanish!)
I am doing this for each dimension, so I can handle each one with different error codes.
Since OriginStationId and DestinyStationId are two values from the same dimension (they both match against the same lookup table), I wanted to know if there's a way to avoid reading two times the data from the table (I mean, not to use two ole db sources to read twice the data from the same table).
I tried adding a second output to the sort but I am not allowed to. The same goes to adding another output from OLE DB Source.
I see there's an "cache option", is the best way to go ? (Although it would impy creating anyway another OLE DB source.. right?)
The third option I thought of was joining by the two fields, but since there is only one field in the lookup table (the same field) I am getting an error when I try to map both colums from my csv against the same column in my Lookup table
There are columns missing with the sort order 2 to 2
What is the best way to go for this ?
Or I am thinking something incorrectly ?
If something was not clear let me know and I'll update my question
Any time you wish you could have multiple outputs from a component that only allows one, all you have to do is follow that component with the Multicast component, whose sole purpose is to split a Data Flow stream into multiple outputs.
Gonzalo
I have just used this article on how to derive columns for a data warehouse building:- How to Populate a Fact Table using SSIS (part 1).
Using this I built a simple package that reads a CSV file with two columns that are used to derive separate values from the same CodeTable. The CodeTable has two fields Id and Description.
The Data Flow has two "Lookup" tasks. The first one joins the attribute Lookup1 against the Description to derive its Id. The second joins the attribute Lookup2 against the Description to derive a different Id.
Here is the Data Flow:-
Note the "Data Conversion" was required to convert the string attributes from the CSV file into "Unicode string [DT_WSTR]" so they could be joined to the nvarchar(50) description attribute in the table.
Here is the Data Conversion:-
Here is the first Lookup (the second one joins "Copy of Lookup2" to the Description):-
Here is the Data Viewer output with the to two derived Ids CodeTableFirstId and CodeTableSecondId:-
Hopefully I understand your problem and this is of use to you.
Cheers John

'Output Mask' for MS-Access report?

Summary:
I am trying to determine the easiest way to mask the output of a specific column in a MS-Access Report.
The situation:
I have a table of "contacts" that each must belong to an "organization". The contacts table was populated with legacy data, which did not rigidly enforce the relationship between contacts and organizations. On import, if a contact did not belong to an organization it was assigned to a dummy "legacy" organization (to preserve integrity, and allow us to search for and eventually back fill those values).
My question:
My problem is this - When generating a mailing list report from the contacts table the name of the dummy "legacy" organization populates for those pesky legacy contacts. I need to mask this output in such a way that all the other columns of those rows remain untouched and the organization name column is simply blank. These rows need to be included (not filtered), but if their organization == "Legacy", then on the report the organization name needs to be blank.
My thoughts:
I have contemplated a simple VBA macro to make edits to the report once it loads, but I was wondering if there was a more straight forward mechanism. I know Access allows for input masking, does it have anything similar for outputs?
Thanks,
Chris
Why not base your report on a query?
SELECT ContactID, IIf(Company="Legacy",Null,Company)
FROM Contacts
You can also do something similar in a report control, but ensure you rename the control before you set it to a function.

ACCESS: Truncation error when appending CSV data to tables?

I am currently experiencing difficulties when trying to append data to existing tables.
I have about 100 CSV files that I would like to create a single table from; all the tables have different column structures but this isn't really an issue as the associated field names are in the first row of each file.
First, I create a new table from one of the files indicating that my field names are in the first row. I change the particular fields that have more than 256 characters to memo fields and import the data.
I then add to the table the fields that are missing.
Now, when I try to append more data, I again select that my field names are in the first row, but now I receive a truncation error for data that is destined for the memo fields.
Why is this error occurring? Is there a workaround for this?
edit
Here is an update regarding what I've attempted to solve the problem:
Importing and appending tables will not work unless they have the exact same structure. Moreover, you cannot create a Master table with all fields and properties set, then append all tables to the master. You still receive truncation errors.
I took CodeSlave's advice and attempted to upload the table, set the fields that I needed to be Memo fields, and then append the table. This worked, but again, the memo fields are not necessarily in the same order in every data file, and I have 1200 data files to import into 24 tables. Importing the data table by table is just NOT an option for this many tables.
I expect what you are experiencing is a mismatch between the source file (CSV) and the destination table (MS Access).
MS Access will make some guesses about what the field types are in you CSV file when you are doing the import. However, it's not perfect. Maybe it's seeing a string as a memo or float as a real. It's impossible for me to know without seeing the data.
What I would normally do, is:
Import the second CSV into it's own (temporary) table
Clean up the second table
Then use an SQL query to append those records from the second table to the first table.
Delete the second table
(repeat for each CSV file you are loading).
If I knew ahead of time that every CSV file was already identical in structure, I'd be inclined to instead concatenate them all together into one, and only have to do the import/clean-up once.
Had a very similar problem - trying to import a CSV file with large text fields (>255 chars) into an existing table. Declared the fields as memo but were still being truncated.
Solution: start an import to link a table and then click on the Advanced button. Create a link specification which defines the relevant fields as memo fields and then save the link specification. Then cancel the import. Do another import this time the one you want which appends to an existing table. Click on the Advanced button again and select the link specification you just created. Click on finish and the data should be imported correctly without truncation.
I was having this problem, but noticed it always happened to only the first row. So by inserting a blank row in the csv it would import perfectly, then you need to remove the blank row in the Access table.
Cheers,
Grae Hunter
Note: I'm using Office 2010