AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 11.02.2013, 13:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,626 / 848 (80) +++++++
Регистрация: 28.10.2006
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 –
  1. Insurance and Telco companies want to attached scanned copies of contracts, applications, health inspection reports, address/identity proof documents of the customers
  2. Public sector – store job orders, inspection reports, citizen document copies etc.
In cases where these documents are large in number and size, we try to avoid out of box “Attachment” feature of the Dynamics CRM because it rapidly increases the CRM database size. We prefer using some document management solution such as SharePoint, Documentum and integrate with Dynamics CRM. In many cases, the document management solution comes as overhead because –
  1. The need is to just link documents with records – nothing more
  2. No workflow or search required
  3. Upfront large investment in DMS software as well as storage space
  4. Operational overhead in terms of backup and maintenance
Solution

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 -
  1. Blob is storage focused only
  2. Provides storage redundancy – no need for back up, disaster recovery in place.
  3. Secure access provided. The storage data can also be encrypted
  4. No upfront investment – pay as you go (storage size) and it is very low-priced – check this out - http://www.windowsazure.com/en-us/pricing/calculator/
What it takes to mingle both?

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 –
  • Create a container (folder) for each record using record identifier in Windows Azure Storage. Upload record specific documents in this folder.
  • You can upload, download, list and delete documents
  • Can upload any type of document and media
  • Enable role based access to upload, download, list and delete functions
  • Works with both Dynamics CRM on-premise and online
Installation and Configuration of Sample Application

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 –










  • Replace with primary key of the storage account (you can find in azure management portal)
  • Replace with Dynamics CRM Server name which we want to integrate. Note: This setting makes sure that you cannot invoke this application from any other place than from Dynamics CRM web site.
  • Please replace with storage account name created in step-1.

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 &ldquo;mainpage.aspx.cs&rdquo; file and remove the method &ldquo;CheckReferalPage&rdquo; and any reference to this method. Please compile and re-host the application.

7. Configure Role Based Access Control &ndash; 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 &ndash;

a. When using with IFRAME &ndash;

i. Open entity form for customization.

ii. Create a JavaScript code on the &ldquo;Form Load&rdquo; 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 &ldquo;mainpage.aspx.cs&rdquo; file and write role based access behaviour in private method &ldquo;SetRoleBasedAccess&rdquo;. 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, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 11 Blog bot Dynamics CRM: Blogs 0 06.10.2012 05:27
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 4 Blog bot Dynamics CRM: Blogs 0 24.09.2011 01:16
Microsoft Dynamics CRM Team Blog: Update Rollup 3 for Microsoft Dynamics CRM 2011 Blog bot Dynamics CRM: Blogs 3 03.08.2011 09:11
Microsoft Dynamics CRM Team Blog: Microsoft Dynamics CRM Online Upgrades Blog bot Dynamics CRM: Blogs 0 12.02.2011 00:11
CRM DE LA CREME! Configuring Microsoft Dynamics CRM 4.0 for Internet-facing deployment Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 05:29.