Add Entity to a specific solution - CRM 2016 SDK - dynamics-crm

Can I select solution in SDK while creating custom entity?
I have created a patch for solution and now I want to show new custom entities created through sdk only in that patch not any other solution.
How can i do that.Thanks

When you create an entity, it is created in the database and is available to be added to any unmanaged solution. If you want the entity to appear in a specific solution, you have to add it to the solution after you create it.
There is no way to get an entity to appear only in your solution, it will always be visible in the default solution as well (all entities are always visible in the default solution with the exception of system entities, many of those are hidden).

Related

CRM Managed Solution - will Uninstalling remove every custom field?

Here's what happened:
We downloaded a managed solution from a 3rd party.
In the .zip, we can clearly see it only specifies 2 new fields for Account
HOWEVER after importing into CRM... when in CRM we open and look at the managed solution... it shows every single field for Account! Not just the new ones from the zip
We'd like to uninstall the managed solution, and only remove the 2 new Account fields
BUT... the managed solution in CRM now shows every single custom field on Account. Will we lose those too if we delete? Or is it normal for managed solutions when viewed in CRM to show every field for the entity, and we can safely assume only those we saw in the .zip will be removed?
From top of my head I could not recollect from my experience why the managed solution showing your custom fields or is it intended.
Though it should not remove any of your custom components when you’re deleting/uninstalling the third party managed solution, I cannot comment on any third party about perfection.
I would recommend you to do a dry run by installing the managed solution in any sandbox environment and testing yourself by deleting it. This way you can be sure.
Typical managed solution should not remove any of our customization when uninstalled. They should only wipe out their components.

Is it possible to add process for custom entities in managed solution in Dynamics crm?

I have a managed solution where I want to add a process/workflow with custom entities. I am able to add process in unmanaged solution for custom entities but have any way to do in managed solution or any alternative way to do so?
Please suggest me what I can do.
Managed solution is not recommended for regular development lifecycle projects, as the future schema changes will be challenging. Managed solutions are good for redistributable components like CRM REST Builder, where author want to have full control & customizations are not allowed in those components as that may break future upgrades of that particular managed solution.
Still you can go ahead & create a standalone solution with your custom entities, then add a WF for that entity. Finally you can export as managed solution to import in other environments (usually only Prod). This way you can customize anytime in lower region like Dev/QA, but Prod can have managed solution & if anything goes wrong - deleting managed solution in Prod will wipe out components + data. You can change in Dev again & a fresh exported Managed solution can be imported in Prod.
Managed solution components cannot be directly customized.

VS2010 - How can two or more people edit a use-case file at the same time?

I have a solution written in VS2010. I have a modeling project in this solution about use case. What I want is to allow two or more people to be able to edit the file at the same time. Also, I don't want people to overwrite each other. Instead, I'd like VS2010 to merge their changes. Is this possible in VS2010?
It's not advisable for multiple people to work on the same file at the same time, but if you use Team Foundation Server version control, then take a look at the topic Managing Models and Graphs Under Version Control:
Merging Changes in Model Files and Diagrams
After more than one user has worked on a model concurrently, Team Foundation version control will prompt you to merge the changes in the model files. Working on separate projects as described in the previous preceding sections will avoid most of the merges. Ordinarily, the remaining conflicts can be safely merged automatically. The following kinds of changes should cause no difficulty:
Types of lifelines. When you add a lifeline to an interaction (sequence diagram), its type is stored in the root model, unless you have created the lifeline from an existing type.
New activities and interactions are initially stored in the root model.
Adding elements and relationships.
Renaming or deleting elements that are referenced only within their own package.
Working on Shared Modeling Projects
To minimize conflicts between concurrent work on different parts of a project:
Divide your modeling project into packages representing different areas of work. Move the entire model into the packages, instead of leaving it in the root model. For more information, see Defining Packages and Namespaces.
Different users should not work on the same package or diagram at the same time.
If you are using profiles, make sure everyone has installed the same profiles. See Customizing Your Model with Profiles and Stereotypes.
To help ensure that you change only the package that you are working on:
Set the LinkedPackage property of a UML class, component, or use case diagram.
In UML Model Explorer, drag an activity or interaction into your package as soon as you have created it. This element will appear in UML Model Explorer when you create the first node in the activity or sequence diagram.
To help you keep track of packages, rename the package files to reflect the actual package names.
In Team Foundation version control, always perform Check In and Get Latest Version operations on the complete modeling project, never on individual files.
Always perform a Get operation immediately before you check in the modeling project.
Always close all diagrams before you perform a Get operation.
Note If a file is open when you perform a Get, and the operation results in local changes, then you will be prompted to reload the file. In this case, click No, and then reload the complete project. In Solution Explorer, right-click the modeling project node, click Unload Project, and then click Reload Project.
Live editing, like you'd get on Google Docs, isn't possible. If you just want to merge changes once a day I'd recommend a version control system, such as Subversion.

How to track Domain Entities with TFS using the CMMI project template?

My enterprise is about to start a somewhat complex project in which we will probably use Domain Driven Design for the business layer. The project will be developed using Visual Studio 2010, and managed via TFS 2010 using the CMMI 5.0 team project template.
I think that it would be a good idea to use TFS work items to track and manage the definition of the domain entities and the value objects in the business layer. However is seems that the CMMI project template does not have any suitable work item for this. I have tought of the following workarounds:
Use the Requirements work item,
modifying it so that the
Requirement type field has one more possible value, such as "Domain
Entity".
Add a new work item to the project
template.
Give up and do not use TFS to manage domain entities, tracking them on a separate document instead.
My questions are: What would be in your opinion the most appropriate approach? And, has anyone done something similar (managing domain entities using TFS work items) in the past?
Note: I've not heard of anyone trying this before, so YMMV :-)
I'd be inclined to add a new work item type, and link requirements to the domain entities so that you can see which requirements impact which entities, and you can also link domain entities to other entities.
I'd also be inclined to include other informaiton on the work item such as context, aggregate root, etc so that the entity work item has a little more information around it.
Doing it with TFS work items gives you history and tracking, which may well make it may be worth doing, however I'd also ensure I have links from the entity work items to the domain doco as well, assuming it's stored in something like the project portal or other repository.

Is there a better way to refresh Entity Models (*.edmx files)

I need to refresh a bunch of EDMX files in my solution. We have disected our tables into groups and each model represents one component or process. However, there are some overlapping tables, which means sometimes I need to refresh/update multiple Entity Models.
Refreshing a group of different entity models in VS 2008 is slow and dangerous. If I miss an out-of-date model, my application won't work
I need to verify that all of the models in my solution are up to date with my development database.
Ultimate solution: How can I script this? Is there an API to Visual Studio for refreshing an EDMX file? I do the exact same thing every time. Can't I program this?
Ok Solution: Can I set something up in Visual Studio to inform me when an Entity Model doesn't match a DB? What is the recommended way to test the model against a DB?
Thanks in advance.
Check out the EDM Generator
http://msdn.microsoft.com/en-us/library/bb387165.aspx
You could put in a pre-build event to regenerate the model.
It's also wise to pre-generate the Views which increases performance substantially.
Hope this helps.
As far as I can tell EdmGen will only work for WPF apps. Since you are looking to update a .EDMX file you will not have access to the xml files which the EdmGen tries to validate.
I would suggest checking the The ADO.NET blog: http://blogs.msdn.com/adonet/archive/2008/06/26/edm-tools-options-part-3-of-4.aspx
They have an explination of how to update an EDMX file but it is pretty involved. Hopefully VS10 will have a better solution for this.
Open the .edmx file in the Model Browser (double click it in VS.Net). Right-click anywhere and choose "Update Model from Database...". The wizard that opens up will show you a limited diff: new tables and deleted tables. But its granularity stops there. It doesn't show changes in fields, for instance.

Resources