11.02.2013, 13:11 | #1 |
Участник
|
dynamics-coe: Using Windows Azure Blog Storage with Dynamics CRM
Источник: http://blogs.msdn.com/b/dynamics-coe...amics-crm.aspx
============== In this article we are going to talk how Windows Azure Blog Storage can be used with Microsoft Dynamics CRM. Business Scenario In many of the CRM implementations, we come across requirement where certain documents are required to be linked with records such as accounts, contacts, cases, activities etc. For example –
The Windows Azure Blob Storage is an easy and economical option here. The following are merits of using blob storage in place of document management solution in such scenarios -
It is very easy to make both Dynamics CRM and Azure Blob Storage marry. There are well defined and documented APIs for the same. You can custom code integration as per need. I have built a small application (asp.net web application) which can make this integration very simple. The application has a user interface as following – With this application, you can do the following –
I have attached code of the application in the article. Let me take you through steps to perform installation and configuration of the application. 1. Create Windows Azure Storage Account – First step is to buy Windows Azure subscription and then create windows Azure Storage Account under your subscription. Please refer the following link - http://www.windowsazure.com/en-us/manage/services/storage/how-to-create-a-storage-account/ 2. If we try to understand Windows Azure Blob Storage structure in simple terms – A Windows Azure Storage Account can have multiple Containers. Each Container then can store multiple documents and media – each called one Blob. This application creates one container for each record then stores record specific documents and media in this container. 3. I assume you already have Dynamics CRM instance (online or on-premise) ready. 4. Download attached application (asp.net web application) code and make changes to connection strings in web.config file –
5. Deploy the application –
6. Integrate with Dynamics CRM – These are two ways to integrate – a. Using IFRAME – The application has been designed to work by default with IFRAME. It can be configured at entity form level. When you configure the application for an entity, you can then link a document or media to entity record using azure blob as storage. Please perform the following steps for the configuration – i. Open entity form for customization. It can be any entity such as account, contact, case, order etc. ii. Insert IFRAME on the entity form. iii. Set URL of the entity as https:///mainpage.aspx . The is the IIS server name or azure web site name where application has been hosted. iv. Please be sure that you have checked “Pass record object-type and unique identifier as parameters” check box. It is very important to check this because with this setting the record GUID is passed in query string and application uses that to create unique container for the record in the azure storage. Without this setting, the application will not work. v. Please also ensure to un-check “Restrict cross-frame scripting, where supported” check box. It is another important setting because otherwise application form will not post back and it will throw out into popup when posting back. vi. Finally save and publish the form customizations. vii. You can now open entity record and link files to the record. Note: In case of new record, the application will not upload files unless the record has been saved. Remember it needs record GUID to create container for the record in the azure blob. b. Using Ribbon Button – you can also configure the application with ribbon button but it needs some level of coding. I plan to create a ribbon in next version which will make integration easier. For now – please do the following – i. Open entity form for customization. ii. <span style="font-size: small;"><span style="font-family: Calibri;">Create a ribbon button. Customize ribbon button to call a JavaScript function. The Java function should open the URL (https:///mainpage.aspx?id=) using Window. Open method. The is the IIS server name or azure web site name where application has been hosted. The is the GUID of the entity record. iii. In the application, please open “mainpage.aspx.cs” file and remove the method “CheckReferalPage” and any reference to this method. Please compile and re-host the application. 7. Configure Role Based Access Control – I have not provided any role based access in the application but there are extensions available to easily configure the same. Please do the following – a. When using with IFRAME – i. Open entity form for customization. ii. Create a JavaScript code on the “Form Load” event which passes user roles (Xrm.Page.context.getUserRoles()) in the hidden text box (id=iroles, name=txtroles) of the IFRAME page. iii. In the application, please open “mainpage.aspx.cs” file and write role based access behaviour in private method “SetRoleBasedAccess”. Essential, you will read user role names passed and enable\disable control as per access provided to the role. b. When using with Ribbon button - In ribbon button, implement the logic of JavaScript written above using HTTP POST methods. Conclusion This is a sample implementation to expedite basic integration of Windows Azure Blob with Dynamics CRM. I am sharing code with you; please feel free to make necessary changes in the code as required. Hope you like this article. Источник: http://blogs.msdn.com/b/dynamics-coe...amics-crm.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|