How to write a custom web form in Dynamics CRM 2013 - customization

I have a requirement of a custom grid in Microsoft Dynamics CRM 2013. From a SharePoint perspective, it would have been a web part. But in CRM 2013, I don't see a similar concept. I need the custom grid to be displayed in a pane for an Entity in CRM? How could that be implemented if possible? Any ideas?

Your question is to broad, but i think what you mean is how to make a custom web page in CRM.
In Dynamics CRM 2013, you cannot add a custom aspx page, as part of a CRM,
you can only put custom Silverlight and HTML/Javascript powered web pages, the latter being the preferred way, of creating these.
However if you need to create a custom web application, you can create it as a separate web application in a separate IIS website, use the CRM web services to access data, and then embed this web application in an iframe on an entity form in CRM.
In order to connect to the crm web service, from custom apps you can use early or late binding.
Early binding sample code
Late binding sample code
Personally i use late binding as connection is easier and it seems to have better performance. The simplest way to obtain a connection to the CRM service for CRUD operations is the following code:
string connString = "Url={DynamicsCRMUrl}; Username=username; Password=password; DeviceID=AnyDeviceId; DevicePassword=AnyDevicePasscode";
CrmConnection crm = CrmConnection.Parse(connString);
IOrganizationService service = (IOrganizationService)new OrganizationService(crm);
For crm online and IFD configured CRM you must add the DeviceID and DevicePassword, for on premise it is not necessary.
Make sure you have the CRM 2013 SDK for the required assemblies.
I am answering the question with a long shot, with assumptions, as i am not sure if this is what you require, but i hope it gives you guidance.

You can add an HTML WebResource in CRM that contains the grid to be displayed.
Depending on what you want to display on the grid, the data could be populated using the Dynamics CRM SDK REST API. (see SDK.REST.js).
Once you have set-up your HTML web resource, you can then include it in your entity form as an iframe component (similar to a SharePoint web part).
This approach means you don't need to host the grid in a separate website, but can include it as part of your CRM solution.

Related

Integration between custom system and Crm Dynamics 2016 Online

I'm working on Dynamics since about 1 year, and I'm working on "on premise" environments, and I don't know very much about online solutions.
I should now integrate 2 systems through webservice, and one of them involves Microsoft Dynamics CRM Online 2016.
What I'm trying to accomplish is that the custom systems sends data to the CRM Online through webservice.
I've read I just can't deploy my webservice and my logic as I've always done (separate web application that receives a Json or a XML through web services and works on CRM entities through the SDK).
So, do I need a separate machine to receive the XML and working on the CRM through the SDK?
In some posts I learn a little about Azure, but I don't know if it could be a nice solution. Should I get a virtual machine and then install IIS? Will my web app be visible by the custom system and able to work on the CRM online? Do I need a different service?
Thanks in advance and sorry for the confusion, it's the first time I'm trying to make CRM Online communicate with the outside.
So if I understand correctly your approach is 'custom system <=> your WS <=> CRM Online 2016
I've read I just can't deploy my webservice and my logic as I've always done (separate web application that receives a Json or a XML through web services and works on CRM entities through the SDK).
In CRM Online you don't have access to machine that CRM stands on so no folders, no inetmgr, no deploy.
So, do I need a separate machine to receive the XML and working on the CRM through the SDK?
Yes.
Should I get a virtual machine and then install IIS?
It doesn't have to be new virtual machine. It could be for example machine that custom system stands on ofc. if it can be configured to have access to the internet.
Will my web app be visible by the custom system and able to work on the CRM online?
It is matter of configuration of NAT, firewall etc.
Do I need a different service?
What service do you reffer here?

Calling an external API from Microsoft Dynamics Nav

I am researching how to integrate Microsoft Dynamics NAV with my existing REST API (built on Django REST Framework). What I would like to do is trigger API calls from NAV to CRUD objects via the REST API.
Reading the web services docs for NAV, it seems clear that NAV can expose a web service for other software to consume from. But can NAV consume 3rd party APIs? In the web services examples documentation, it says:
Solutions that need to execute business logic or read data from
Microsoft Dynamics NAV are candidates for Web service implementation.
These can also be solutions that write data to Microsoft Dynamics NAV
and validate the data using existing business logic.
Also, it gives the following example of how to use web services:
Execute any kind of business logic that is more easily developed and
managed in Microsoft Dynamics NAV.
However, I don't see any examples of data writing. It doesn't seem that in the exposure of web service pages or codeunits, there's a way to make calls to 3rd party APIs and execute business logic with the data that comes back within NAV. Is this actually possible?
Unfortunately not, no.
You do however have access to the full .NET framework from within the 'Development Client' of Dynamics NAV - When defining your variables select the Type of DotNet
It's far from perfect, so for larger tasks I'll create AddIns or completely external libraries (depending on version).
For something smaller like this I personally find it easiest to write it in C# as a small (console) app and the 'translate' it back into Dynamics NAV.
If you are looking for way to invoke a web service then why do you need Nav web services? Nav web services is a way to call Nav.
These can also be solutions that write data to Microsoft Dynamics NAV and validate the data using existing business logic.
This means if you invoke published Nav web service then you can pass data to your call and the data will be validated and saved to Nav. So this is about how to push data to Nav, not pull from external system.
If you want to invoke a web service from Nav consider this options:
Write external wraper library (as mentioned by #SeeSharp or as described). Then use it in C/AL as DotNet or Automation types of variables.
Use existing libraries like 'Microsoft XML, v6.0'.XMLHTTP60 right in C/AL to make http calls to your web service.
Do it Navision style.
Last damn option is to write console application that will consume your web service and call it from Nav using shell. This is not an option, I know.

Accessing Sharepoint lists from a Standalone Application

I have a Standalone application, which needs to access a Sharepoint list. I bumped into a few articles, mentioning Web Service is the way to go about it.
But I am unable to find a step by step path to write a web service to fetch list from sharepoint. In addition to this, the application can take a WSDL file as an input.
Please let me know how to proceed about this scenario.
If you are using SharePoint 2007, then web services is the only way to do this. Here is a list of the different web services available.
If you are using SharePoint 2010 you can use the client object model.
You can simply use the SharePoint webservice Lists.asmx (both in SharePoint 2007 and 2010)
In your application, add a web reference 'http://(sharepoint-url)/_vti_bin/lists.asmx'
Once done, you can use the method GetList.
For more information, http://msdn.microsoft.com/en-us/library/lists.lists.getlist(v=office.12).aspx#Y82

Microsoft Dynamics CRM -- Do people build websites with it?

Forgive my ignorance, but do people build websites with Microsoft Dynamics CRM?
I have a potential client who says that is the technology they will use for a new web project, for which I would be doing the HTML templating. I want to learn all I can as I am new to this particular system, but I can't seem to find anything related to web building and CRM. Is it more likely the client is using another piece of technology that they are neglecting to tell us about?
Any experience or insight about this process is greatly appreciated!
You can't build website using MSCRM, but you can build ASP.Net website using CRM content easily. The API provided by MSCRM is a set of web services, that can be queried in a website to populate pages content.
Also, you can directly query the Database if you want ReadOnly content, and only for read-only content, because it is not supported to update/create data using SQL connections.
Note that it's required to have the external connector license to use any data in the CRM, thru the API and even thru direct SQL queries.
I have built a website using .NET, utilising the CRM4 API and database. All the website did was to submit queries to CRM using the CRM web services and metadata web services, and get data back. This company was already using CRM for their back end, so it's much easier for the front end to use the same database as well since it's a simple one.
The alternative would be to create an intermediate connector between the 2 systems -- backend and front end, which is not as efficient (for our case anyway).

Using a Web Service to access data outside MOSS using AD for authentication

So here is the scenario:
I have a MOSS 2007 box and I want my clients to be able to access a SharePoint site via the internet. I am told that I will be using an IPA and AD for authentication. However I have a DB outside of SharePoint that holds various business data and I want to use Web Services to access the data, manipulate it, and send it back to SharePoint via web parts.
The issue is that, from what I understand, I am going to have to authenticate the AD user every time a request to the Web Service happens. Obviously I dont want to do this every time because they have already authenticated to get onto the site, however I do want each call to have some form of security so its not open calls to my db. I do plan on having other applications access this service outside of SharePoint, so I dont want to have to reinstall the service for each application or even again.
Has anyone had to perform this task or something similar or do you have any suggestions on how to do this?
Thank you in advance and happy coding!
Why not just deploy the webservice to Sharepoint using a Sharepoint solution and a Feature.
That way it will be running under the sharepoint app pool and all authentication is done by sp.
Edit:
Seeing that SharePoint should not be in "control" (as stated in the comment), you should create the webservice, and run the application it's under in as using Windows Authentication. IMHO you should create a WCF Service. The, using the information found in this article you make the Service authenticate users against the AD usergroups they are in. see the "Security: Authentication" section of the article.
Then in Visual Studio you create a webpart and add a service reference to the project, pointing to your newly created Service. Have the webpart perform the needed logic (i.e. display data etc.)
Deploy the webpart to SharePoint using a SharePoint solution (.wsp files, created with WSPBuilder). Google for SharePoint + wspbuilder + tutorials. The solution should contain 1 feature to deploy the webpart. WSPBuilder integrates with VS and allows for the creation of WSPBuilde project. add a webpart feature item to the project (it will create the xml (deployment related) and code file for the webpart.