How can records of different entities be created on an import?
I have custom entities that describe the product; like department, manufacturer, and category.
The requirement is to perform a single import that creates and updates records;
this included price list items for (possibly) multiple price lists.
The other requirement is to view all records that will be created/updated.
Currently I have an entity called staging that I import to.
A plug-in listens on Create and processes each record individually - creating/updating multiple entities.
Is there a better way to solve this problem?
The other side of the equation is to view what will change in the system.
I have another custom entity called import, a single record with the same sequence number as the corresponding import is created for each import.
An html web resource displays the changes that will be made in a list.
JavaScript on the web resource queries CRM (big imports may be a problem)
On the import entities's ribbon is a button called process import, which fires another plug-in (which was listening on Create of another entity, internalprocessimport, the JavaScript of the ribbon button creates a record of this entity - also with the original importsequencenumber), this plug-in processes all staging entities with the right importsequencenumber.
1
votes
1 Answers
1
votes
When you say view what will change, are you referring to a text based log that lists what's been done? If so, you could add a field to the staging entity and have its plugin write to it, perhaps.
Just make sure to truncate the text mass so that the size of it will fit within limits of the maximum length of the text field. Otherwise you'll be puzzled by the error message that comes with that.
Also, when you create the entities, are you using QueryExression object? I believe CRM is supposed to get a better handling of multiple operations in UR12. Haven't tested it myself, yet, though.