Issues after importing multiple managed solutions customizing Opportunity entity - dynamics-crm

I would like to explain the exact scenario as follow:
There are two CRM instances - one is development (or Dev), and the other is sandbox (or UAT).
I did some changes in the Main form of Opportunity entity (added new fields, and a few more UI changes) in a custom solution in Dev instance. Exported the solution as Managed one, and imported in the UAT instance.
At this stage, Opportunity form appears same in both Dev and UAT instances.
I have created a new solution in Dev instance, and added Opportunity entity again. Did some changes in the Main form of Opportunity entity again by removing some UI elements, and by adding some new fields.
Exported the solution as Managed one, and imported in the UAT instance.
After publishing the changes, I can see that the Main form of Opportunity entity now contains all newly added fields, but also the fields which I had deleted in the Dev instance.
In summary, it didn't delete those fields from the UI of Main form, but just added the new ones.
Could any one please help me sorting out this issue? What could be the possible reason here?

It is by design that changes to forms are merged when importing multiple managed solutions. The MSDN article Understand how managed solutions are merged is a good read for understanding this:
When a solution is packaged as a managed solution the form definitions
stored in FormXML are compared to the original FormXML and only the
differences are included in the managed solution. When the managed
solution is installed in a new organization, the form customization
differences are then merged with the FormXML for the existing form to
create a new form definition. This new form definition is what the
user sees and what a system customizer can modify.

Related

Microsoft crm dynamics legacy web interface app

I'm very new to Microsoft CRM, so please fix me if i'm wrong.
I have a business app that has the old web interface.
I don't want to setup a new solution for a client and provide a new api.
A want to reuse what is already there and adjust what data I will get when I request some project query.
My problem is that I cannot find where the schema is defined.
Can someone point me where to look for it?
Right now the api is working and I can retrieve data without problems, but there are some missing fields that are present CRM and not accessible via api. And my goal is to provide those fields
Thanks
go to make.powerapps.com
on right hand side select your env (dev/Test/Prod)
after that select solution on left hand side
then scroll down complete list you will find default solution
once you visit default solution, It hold almost entire system schema and so on. For example tables, it's fields and so on.
there are many other ways, but this should be a good starting point.
Note: It is not recommended to make changes directly under default solution, In fact it is bad way of making changes.

How to centralize validation rules in Asp.Net MVC 4?

Below is a sample scenario:
User can create and/or update a policy online. While updating, user may change the start date of the policy. Condition is, if policy start date has passed (means smaller than today) then, start date can't be changed, else it can be changed.
My problem is:
There can be 5 types of policies and each has some common properties as well as some uncommon properties. Now I want to validate those properties against my business rules (like the sample) from a centralized place (may be class or whatever). But I am stuck on how/where to start.
Currently trying:
Currently I am validating those properties inside Controllers and sometimes inside Views but that is requiring lots of manual work and code maintenance will be troublesome in future. Can someone please give some idea.
Environment:
Asp.Net MVC4, Razor, VS2013

VS2015 Domain project(class library) after loading not fully accessible

I have 2 VS solutions.
The first solution has a WebUI project in .Net 4.5.2 and a Domain project also in .Net 4.5.2. The WebUI depends on the Domain and holds a reference to it. The Domain builds first. Everything works.
The second solution has a WebUI project in .Net 4.6. I "added" the Domain project from the first solution here (by clicking right mouse on my solution name --> Add --> Existing project).
I added a reference here also and the Domain builds before the WebUI just as in my first solution. Things work correct, for example, I can create a viewmodel in my WebUI and reference to a domain class. I can also acces the domain classes after using an import statement in my controllers. See second pic where I use the person class and contact class. This all works fine. I have some issues however.
In the WebUi's when I want to generate a mvc5 controller using entity framework in my first solution I see in the model class dropdown list my domain entities.
However, I don't see these entities(Domain.DbEntities) in my second solution in the dropdown, which I find very strange since I can acces the domain entities from whitin code-files which you can see in de background(i.e. 'person' and 'contact' in my EditPerson(int id) action method
Anybody an idea why?
Maybe the different framework version is the problem.
Have you build the project already?
See also: Add Controller Model Classes not shown

what is the correct approach in order to host / integrate / show my existing MVC3 project inside orchard?

I've an existing MVC3 project that implements a certain functionality, this project has it's own views, and a separate Database.
now I'm required to use the same functionality inside one of my orchard project,so I thought that I can host this solution in somewhere and view it inside an iframe or something.
Am I thinking right?,
is this the correct step to take in order to achieve this requirement inside Orchard?
to make it more clear, all I need to do is to view this solution and interact with it's controls and views from a hosting page inside orchard, and the subsequent requests should be handled by my solution in order to hit it's own data store and get back with the requested data in order to be displayed to the user.
any help would be appreciated.
Update:
thanks for Bertrand Le Roy for his answer, I can now view my solution inside my
orchard website.
I came in to one more HUGE problem, which is that my application can no longer connect to my external database.
I've a DB that is hosted in some where else, and I'm using EntityFramework to deal with it.
the problem is that if I put the connection string inside my module web.config, or main orchard web.config, I run into several types of errors like:
"System.Reflection.TargetException: Object does not match target type."
or
"System.Data.MetadataException: Unable to load the specified metadata resource."
My question is: How could I pass my connectionstring correctly to my solution, assuming that I'm using Entity framework as my ORM.
Many thanks.
You will need to put it into a module.
You will have to move route definitions to a Routes.cs file (look at any existing such file for examples).
You will also need, in order to access your data store, to opt out of the ambient Orchard transaction around the data access code (using (var scope = new TransactionScope(TransactionScopeOption.Suppress))).
If you are using dependency injection, you may have some work to move that to the Autofac-based way of doing things in Orchard.
If you want your work to appear seamlessly in the Orchard admin, you may want to decorate your admin controllers with the Admin attribute. If you want your front-end to use the current theme, you'll have to add Themed attributes and maybe refactor your views so that they only emit HTML for the content zone instead of for the whole page.
Add a manifest (module.txt) to your module folder and you should be good to go.

Dynamics CRM Managed Solution Add Customer Set Parameters

I'm creating a solution which will be released as a managed solution for Dynamics CRM Online.
However, the customer will need to put information in when installing the managed solution to allow interaction with outside services.
For example, when you install the LinkedIn solution, you need to add your log in information to allow the CRM to access your LinkedIn account.
How do I add these parameters to the a solution, and then allow the customer to update them if they change?
Cheers
Edit:
To add to my query and following the answer below.
To make sure the process is correct in my head.
Option 1.
I will create a custom entity for storing key/value, or username/password combination.
I would then create a customisation page for the solution using html web resource, which when submitted, javascript would create a single record to hold those values.
I then need to link every record that needs the values stored in the custom record - I'm not sure how this would be done without editing a workflow after the storage record has been created, to link each normal record to the storage one.
Option 2.
Create an xml web resource that stores the values. Create the html/javascript resources to update this using the configuration page.
I can then use a javascript function to obtain that data when the custom entity is created, perhaps to populate hidden fields for storage and use behind the scenes.
I can't find any tutorials on getting started with using xml in this way - can you point me in the right direction?
I typically create a "Configuration" entity that has Name/Value attributes. This is also useful when you have Dev/Test/Prod environments that require different configs (e.g. URLs, credentials, etc).
Another approach is to using Plug-in configurations or Web Resources to store that type of information. The Plug-in configuration is pretty straightforward if you can have the customer use the Plug-in Registration tool to modify the value.

Resources