Dynamics CRM 2015 Import values - dynamics-crm

I am using Microsoft Dynamics CRM 2015 on-premise version.
Im importing my solution to an other organization with custom entities and workflows.
I created a workflow to do some work depending on the type of the inserted queueitem.
My issue: Some conditions in my imported workflow are not supported in the new organisation (only the conditions on the custom entities are not supported and are replaced by empty brackets)
I think the custom entities IDs are not imported with the same values, so, the CRM does not recognize these custom entities condition.

Try exporting and importing the customization in two separate solutions.
In the first solution include the entities and optionsets you wish to import. Export the solution from the old environment, import into the the new environment and publish.
In the second solution include the workflows. Oncce again export the solution from the old environment, import into the the new environment and publish.

When you point to an entity inside a workflow, it will retain the GUID.
If you export/import the workflow, the reference will be lost because that specific GUID won't exist in the new environment.

The issue is indeed that the GUID values of the records referenced in your workflows are passed trough the solution but doesn't exist in your target environment.
You can either:
Modify you workflows, instead of (for example) Primary Entity Opportunity / Account / Equals / Contoso use Related Entity Account / Account Number / Equals / ContosoNumber
Import the data referenced in your workflows by keeping the same GUIDs. This is slightly more technical:
First, you need to export the data from your source organization (either SQL or Export to Excel with reimport enabled)
Then convert this file to csv while keeping the id value embeded
Reimport the file with import wizard and mapping the GUID column

Related

Deploying solution from Dev to Production fails because column with same schema name data type was changed. Object dependencies won't get deleted

So the column in question was a lookup column, which i deleted in the unmanaged solution, and mistakenly created a new column with the same name. Dynamics by default will use the same auto-generated schema name based on the display name. So when I go to import the unmanaged solution in my dev environment into the production environment as managed, obviously it throws an error because of the mismatched of data types per column schema name.
Error returned by Azure Pipeline
So I did the sensible next thing, and went to delete this column in my dev environment. But oh no! There are object dependencies which prevent me from deleting it, okay I look at which objects depend on this column, it is a form, i remove the column from the form, go to delete and oh no again! There is still a dependency on the form I just deleted the column from.
So what do I do? I can't change the column schema name, I can't change the data type back to the data type that's currently in the managed solution. Is this when I open up a microsoft support ticket? Hopefully someone here has some insight. Thanks!
The attribute can be associated with a custom control. Try removing this custom control using the classic form designer. It should be visible on one of the field property tabs.
If the attribute cannot be found anywhere on the form using the classic or modern form designer, try this:
Create a solution with this form only. Export the solution as unmanaged. Extract the customization.xml from the zip. Edit the xml and remove all references to your attribute. Paste the customization.xml into the zip and import and publish the solution.
The only way to delete a managed component is to upgrade the solution. In your case, you can delete the field and dependency in solution and apply the upgrade to target environment. Please noticed that all data in this field would get deleted when you apply the upgrade. You may check this link for more detail

Importing my Unmanaged Solution does not change the Account form

I have a customized Account "Main" Form in CRM.
I added a new tab, a new section, and new fields inside it.
I published all customizations before-hand, then export, then import into my test environment. I publish all in the test environment.
The Unmanaged Solution contains this form and its new fields; When I review the Form XML in the exported zip's customizations.xml file, it indeed has the new tab label, new section label, I can see the fields in the XML.
PROBLEM: But after importing and publishing into the test environment... the changes don't show up!
What I see in its place is the way that section looked BEFORE (not sure how long ago last time it was changed). It's simply not getting my latest changes.
How can an Unmanaged solution import have these issues? What else is there to check/consider? I don't think Solution Layers would cause this since it's Unmanaged, nothing stood out there anyway.
Please follow this check list, also note* with Dynamics it needs more env/info including your environment to trouble shoot, since it could be something in tandem with your env.
1. Usual Suspects in an UnManaged Solution
With yours being an UNMANAGED solution, I strongly suspect its a security permissions issue not setup/enabled in the Target environment, check your logs, you may see something like this
Try these Solution Importing steps
Import your main solution (note* without field security profiles).
Now, Publish all your customizations (note* you can enable/import the field security after this step)
Lastly, Import the second solution which would contain your field security profiles
2. Troubleshooting Checklist
To resolve/hunt down the issue, try these checklist steps
Check IIS: if you reset/restart IIS, (after define and publish your field)
Clear you client side cache: run it by
pressing Ctrl+F5
Clear you server side cache:
https://learn.microsoft.com/en-us/powerapps/maker/portals/admin/clear-server-side-cache
Are using the entity form:
Do you have the correct: entity permissions Notes & Sub Grid
https://learn.microsoft.com/en-us/powerapps/maker/portals/configure-notes
Did you add the metadata
Lastly are you using activities

Tool for creating object representations for Entities in Dynamics

Similar to Entity Framework I would like to know if there is a tool or nuget package I can use where I can just send the Dynamics URL and credentials in order to create object models from a Dynamics System. I'm trying to avoid creating custom DTOs.
You can use CrmSvcUtil to generate strongly-typed classes for entities.
Command line:
CrmSvcUtil.exe /url:http://<serverName>/<organizationName>/XRMServices/2011/Organization.svc /out:<outputFilename>.cs /username:<username> /password:<password> /domain:<domainName> /namespace:<outputNamespace> /serviceContextName:<serviceContextName>
GUI: (by Daryl from community)
Early Bound Generator in XrmToolbox & its video tutorial + documentation
Early Bound Generator included in the XrmToolbox is the simplest. https://www.xrmtoolbox.com/
Find the right configuration then take the command line and include it in a batch file under source control. You'll have to run it each time you add fields in CRM, depending on your needs. If you lose your starting configuration, your code might not be compatible the next time you generate.

The Entity you are trying to import is not the same as the one existing in the database even though it has the same name

when trying to import customizations for a specific entity I get an error saying that I can't reuse system queries for a custom entity.
The error in the title appears in the detailed CRM trace:
Could not import a Saved Query {C9771189-0CB3-E111-A93D-00505699001D} for ObjectTypeCode 10010 because this is a system Saved Query. The Entity you are trying to import is not the same as the one existing in the database even though it has the same name.
the id of the query is the one in the source customizations.
Both the source and target entities seem to have the exact same queries, with the same names.
Google hasn't been able to offer much on this.
Can anyone shed any light on the subject?
Is your source environment upgraded from v3.0? If so have you applied the hotfix (or latest rollup) mentioned in this KB article to both servers?

function import in entity framework

As the MSDN says
Do one of the following from the Model Browser:
Open the Stored Procedures folder (in the storage model information) and double-click a stored procedure that does not have a corresponding function import.
- OR -
Right-click the Function Imports folder (in the EntityContainer node of the conceptual model information) and then select Add Function Import.
The Add Function Import dialog box appears.
How can I do function import if my db contains hundreds of sps. Should I go to each sp and do the steps above :( .. It makes no sense.
I have a very large Entity Framework model and I use the Huagati DBML/EDMX tools. It was able to bulk add new tables, views and columns that were in the database but not in the EDMX. It saved a lot of manual work. I haven't used it for stored procedures but it looks like it supports it. Even better, they have a free trial so you can always give it a try to see if it will work for you.
Edit: It also sounds like they have made some improvements to this in the latest version of EF - the June 2011 CTP. This blog post states:
There are several new features for the Entity Framework Designer
within Visual Studio:
[...]
When you import stored procedures using the Entity Model Wizard,
you
can now batch import your stored procedures as function imports.
The
result shape of each stored procedure will automatically become a
new
complex type in your entity model. This makes getting started with
stored procedures very easy.
If you don't want to use a CTP, this blog post says they might have the official version out next month.

Resources