Thursday, January 10, 2019

"The unit id is missing" for Product in Dynamic CRM


I was doing data import for Product entity from one CRM Organization to another and facing a very common issue, but the solution is little bit different for it.

Before I start further on this thread, here are some tips for doing Data Migration in Dynamic CRM

If you wish to use CRM Configuration Migration, here are some tips to avoid any possible failure - https://vjcity.blogspot.com/2019/02/crm-configuration-migration-not.html

I started reading about this issue on internet and community blogs and everyone commented that Product might be missing below these two attributes

Display Name
Internal Schema Name
Unit Group
defaultuomscheduleid
Default Unit
defaultuomid


I double checked for all Products to verify where I missed providing these value, but guys wait these two attributes are mandatory by default in Dynamic CRM. Not a single product I have without these attributes populated.

What next - I was asking to myself

I observe that not all products are failing to be imported and I had a problem with only few. I was able to find that which all products are not getting imported by comparing what got imported and what not. This helps me narrow down my investigationJ.

I further observed that in Product configuration for the products which are failing to get imported are configured with Default unit whose base Unit is not set or you can say Product are configured without base unit.




Solution
For product data migration, I then took following approach
  • Created a Dummy Unit and set its Base Unit to the one who equivalent to the one.
  • Changed Default Unit of failed product to the Dummy Unit created here.
  • Change the Unit of PriceListItem to the Dummy Unit too.
  • Run the import and revert back the Dummy Unit to the original one.

Bonus Tips
  • Products that are retired, do not get linked to the PricelistItem and therefore import will failed to link up them during import.
  • Avoid Bulk update with all related entities and completely rely on migration tool or your code. Follow a sequence in Import especially in Product related import. Here is a sequence
  1. Unit Group
  2. Unit
  3. Product
  4. PriceListItem
  5. Account, Contact, Opportunity, Quote, Order and Invoice.
  • Provide name of the Product and Product ID to be unique to easily located in Lookup.

Regards,
Vipin Jaiswal
Vipinjaiswal12@gmail.com

2 comments:

Anonymous said...

Hello,

Same issue but i resolve it differently.
The name of my unit (month) was used in different Unit Group.

UG1 : month,year
UG2 : day, month


I change the others names :

UG1 : monthly,yearly
UG2 : day, month

and import was success :-)

bye

96561133 said...

I might be doing something wrong, but the import is functioning well as long as I don't add the Parent column to the Excel file.

If my view has the Parents exported, I then add a new record and assign it to the same Parent, the Product cannot be imported.

I keep getting the same error over and over again.

"The unit schedule id is missing"


Changed the default unit as suggested, checked all unit groups and units for duplicates.

Any other ideas?