Tag: documents

  • Why would you store images and files in CDS?

    Why would you store images and files in CDS?

    The Common Data Service is often though as a relational data store that resembles the former XRM database. While there is backward compatibility in the sense that you can do everything with CDS that you could in XRM (Online), the real power of the cloud platform comes from going beyond those limits. Earlier I’ve talked about how The Real Common Data Emerges as we start to work with a variety of different data types and even reaching out into the Azure Data Lake as part of leveraging the Dynamics 365 first-party apps. This time I want to drill deeper into the specifics of images and files as new field types available in CDS.

    Feature announcements from Microsoft

    The concept of CDS heterogenous data storage was demonstrated back in Business Application Summit 2019 in June. As illustrated below, alongside the traditional SQL database for relational data, CDS now offers also the option for binary (file) data stored in Azure Blob Storage and log data in CosmosDB, as well as search indexes offered via Azure Search. All of these are are available under the common entity schema and business logic defined in CDS, without requiring the app makers to think about what data goes into which specific service and how. This is how the Power Platform provides a higher level of abstraction compared to code based app development on top of the raw Azure services.

    Fast forward a few months to Ignite 2019 in November, where Ryan Jones presented a session on “Connecting Power Apps, Power Automate, Power BI and the Common Data Service with data”. The capabilities promised for the new image data type were as follows:

    And here’s the equivalent slide for file data type:

    In December 2019 there have now been announcements made on the Power Apps blog about Introducing File and Image datatype, as well as the availability of the public preview of file attributes on Power Apps Canvas apps. Things are still in the process of rolling out and support for Model-driven apps hasn’t yet even been demonstrated anywhere, so this isn’t something you can jump into using right away.

    Scenarios for files in CDS

    Traditionally in the world of CRM projects we’ve always advised against putting files into the database. “Keep ’em in SharePoint” has been the standard answer, which still makes a lot of sense for any collaboration on content creation, document versioning and so on. The SharePoint document management integration in CDS offers an out-of-the-box experience that generates document locations linked to specific records in CDS and allows working with them through the Model-driven app UI. If you’re happy with auto-generated folders under a single document library on a single SharePoint site for all the records of a particular CDS entity (like accounts), there’s no need to look any further. In real world customer environments the OoB integration is often not sufficient, and I’m really glad that things are improving with the Microsoft Teams based document management integration offering a more practical security and data location model. (Note that currently the Teams integration can’t be enabled for pure CDS environments without Dynamics 365 apps.)

    The problem that still remains is that both the direct SharePoint-CDS integration as well as the Teams-SharePoint-CDS combo don’t offer much business process context for the files. It’s more of a helpful tip like “hey, if you’re looking for documents related to this account/project/order/inspection, try searching from this folder”, rather than a very specific instruction about which particular file contains information on what step of a business process managed in CDS. You also can’t really verify whether a required document exists in the system before proceeding further in the process, since all you have is links to a folder which might or might not contain that file – or multiple copies and various different file types when what you’d really need is a single required PDF, like a signed agreement document.

    With the new file and image datatypes, you can actually define a specific field to store a specific type of document or image. This will let you know exactly what the business purpose of a particular piece of binary data is, which means you can develop app functionality like user interface and business logic around it. It’s no longer just 0…N files linked from another system (like SharePoint), it becomes an integral part of your business process. The demo that Ryan Jones did at Ignite about an inspections app is a good example of what the “strongly typed” image and file data could be in practice:

    Having rich metadata about what a particular document represents in the real world is great, but what’s an even bigger benefit is the security model around it. As anyone with an XRM background knows, the ways in which you can configure the security model in CDS is very advanced, offering granular control of who can create, read, update and delete data. You have security roles, business unit hierarchies, position hierarchies, owner teams, access teams, sharing, even field level security. Any security logic that you apply on the entity that’s hosting the file or image field will also guard access to the binary content. If you’ve ever tried to sync the security information between a Dynamics 365 based CRM system storing customer records and the SharePoint environment storing the related documents, you’ll know how difficult and error prone this attempt is. The security concepts of those two systems are inherently different and even Microsoft is unlikely ever offer anything close to 1:1 integration (Teams is about as close as you can get.) For access control of sensitive documents and images, these new datatypes in CDS are therefore a very attractive option.

    Attachments (annotations) vs. file/image datatype

    Let’s not forget that it has always been possible to store binary data in CDS, even in the on-premises days. All your tracked Dynamics 365 emails will have automatically uploaded their every attachment into the Note entity. Additionally the users have been able to add notes with attachments on the Timeline of any entity where the attachment feature has been enabled.

    As part of the new storage capacity model launched in April 2019, Microsoft will have already migrated all of the attachments previously stored in the SQL database to Azure Blob Storage behind the scenes for any Online environment. However, this doesn’t make the attachments feature any more modern and you should seriously consider not using it in the future (where possible). While there is a somewhat better security story with the data all being behind CDS APIs, you won’t find any customization options here to align the data in Notes entity with your business requirements nor the desired application UI. It’s a fixed way of representing file data alongside the customizable relational business data model, inherited from the Dynamics CRM days rather than a feature designed for the Power Platform era.

    In the meantime, with the lack of better support for image handling, many of us have surely explored the capabilities of building a Power Apps Canvas App that could perform what the above Ignite inspection demo app does. Dropping a camera control on the Canvas App is so easy, yet storing the captured image into CDS alongside the other inspection data has been next to impossible. Yes, attachments as a separate control has been available for Power Apps makers for quite some time, but patching the image data from somewhere else into a new CDS attachment record is the tricky part. Complex record references like the Regarding field on the Note entity in CDS have long been a stumbling block for Canvas Apps, and as of today you still can’t write data to that field. Jumping through hoops made of Flows and Custom Connectors is hardly the kind of seamless experience you’d expect from a low-code application platform when working with camera images, so there definitely has been a big demand for the image datatype to come and replace the clunky attachment feature.

    Back when CDS was just the storage place for structured data that was accessed via the metadata driven UI of Model-driven apps for CRM scenarios, there weren’t that many places where visually pleasing stuff like images could have been used. The entity image with its glorious 144×144 resolution has been cool for demo data, but how many customers have actually ended up populating logos, profile pics, product images or other visuals in there? With the rise of citizen developers armed with Canvas apps that offer pixel perfect UI development, the situation is now quite different and there’s an expectation to be able to work with full-size images as well as showing thumbnails for visualizing the business records.

    Things to keep an eye on

    As mentioned earlier, we haven’t yet been able to truly validate in real life Power Apps what functionality files and images support. I’m expecting there will be further chapters in the story of how heterogenous storage in Common Data Service evolves over time, so the first release for Canvas Apps and later Model-driven apps may not yet be feature complete. How the data will work with PCF controls/components and other features of Power Platform (automation, offline, search, AI…) is going to be a big factor in deciding whether storing files and images into the dedicated CDS datatypes is the right call for your app. Of course you’ll also need to examine the options from the other Microsoft clouds: Azure and Office.

    If you’re doing custom code development and expect to deal with a large amount of binary data in your app, doing the math on storage cost between the configuration friendly CDS and raw Azure Blob Storage is probably going to be an item on your solution design agenda. Just like with relational data, CDS is always going to be priced as a premium service compared to things like Azure SQL, because it provides you so many layers of additional features you’d otherwise have to build and maintain. Storage is only one part of the equation, but of course you’ll need to ensure the business case is valid when consuming Power Platform storage capacity with its associated services.

    If the applications you build are aiming to support the collaboration of information workers over unstructured data like Word documents with co-authoring and several versions, then that data clearly doesn’t belong into CDS. Use MS Teams as the security mechanism where possible and allow the users to work with the documents through SharePoint, offline synced OneDrive folders, Office applications on any device etc. If there is an end product that comes from this collaborative process and needs to be carried along in a structured business process, then that file could well be stored into a CDS file attribute.

    It will be interesting to see how Microsoft will align these file & image attribute features with the existing attachments feature. Having a predefined number of fields per entity where you can drop a single file is obviously quite a different experience than an open “folder” that could accept as many files as needed. Although on the schema level, also the Notes (annotation) collection only accepts just one attachment per each note and the rest is just UI. Whether we’ll receive a true customizable Notes feature from MS with metadata support and a modern control to complement the standard Timeline visualization on the Model-driven app as well as the attachments control on the Canvas side is something that remains to be seen. I’m also expecting to see some community contributed PCF controls in the near future around the new datatypes.

  • File storage and CRM: what you should know

    File storage and CRM: what you should know

    Dynamics CRM is a great system for managing your customer data. “Alright, so can you tell me how do I upload all my customer document folders in here?” Well, you don’t. Or more precisely, you better not do it. You see, while it’s more than likely that you have lots of files regarding your existing and potential customers, putting these into your customer relationship management system is rarely a sensible approach. Let me illustrate a few issues that you will encounter if trying to use file attachments in Dynamics CRM as document management solution.

    Storage cost

    Due to some recent announcements on pricing & functionality related updates in Microsoft’s cloud based services in April 2012, I decided to do a little comparison of storage costs between three services. SkyDrive, a consumer focused product that has very recently acquired Dropbpx-like skills of synchronizing content from one or more client PC’s (or mobile devices) into the cloud. SharePoint Online, the SaaS edition of Microsoft’s collaboration / content management platform that’s currently licensed to around 125 million business users around the world in all it’s editions. Finally, CRM Online, the Microsoft hosted version of Dynamics CRM. All of these products include some base level quota for storage, but since the subscription prices per user are not really comparable due to the application functionality included in each, I’ve instead chosen to compare what is the cost of an additional 50 GB storage on each service.

    See the percentage difference in the table when compared to SkyDrive? While a pure file system storage service in the cloud for consumers is practically free these days, as we move towards more structured databases with metadata and workflow related functionality wrapped around the file, things tend to get more expensive. SharePoint Online has just recently cut it’s storage prices by a whopping 92%, yet it remains almost five times as expensive as SkyDrive. Since the price per GB on Dynamics CRM Online has not changed (at least yet), CRM in turn is 50 times as expensive as SharePoint Online. (Note: storage space ain’t cheap on other cloud based CRM systems either, including Salesforce.com).

    Ok, so maybe you’re managing your own servers and SAN’s, which means the direct cost per GB isn’t dramatically different between file shares and database blobs. Let’s look at some application level features that will affect your CRM users nonetheless.

    Search experience

    If we put our files into a structured database that has lots of customer information already, surely that makes them easier to discover when needed? Well, to some extent it does, but not necessarily the way you’d expect. “Did I attach that document to an account, opportunity or contract?” When it comes to Dynamics CRM, you’ll need to be able to answer this question before performing your search, as there is no out-of-the-box way to perform search across multiple entities. Also, instead of entering a natural search phrase like “online migration scribe”, you’ll need to build your query one parameter at a time in Advanced Find, specifying which values should be found in which field or related entity.

    Chances are you found this blog post through Google. That’s the way us humans tend to find what we’re looking for nowadays: free text searches on whichever keywords we have in our minds, rather than selecting a combination of attribute values that correspond to the parent object of the file we are after. Oh, and in case you wanted to search for text from inside the document, forget about it. Attachment contents is not indexed in Dynamics CRM, only fields on the entities directly are available for the search tools.

    Editing experience

    Do you ever need to revise the documents you’ve once created? Having the file as an attachment on a CRM record doesn’t quite give you the same kind of flexibility as a network drive or a document management system. You can’t directly open a document from the system into your MS Word, start editing it and save the changes. Rather you’ll need to store it temporarily on your local hard drive, then upload it back to CRM. The number of clicks and dialog windows involved in the process will not exactly encourage your end users to share information through CRM if they need to go through these steps repeatedly.

    How about archiving different revisions of the document? Let’s not even go there, at least with CRM alone.

    What should we do with our files then?

    While it’s certainly not the end all, be all solution for document management, you should definitely give SharePoint a go and see if it delivers the type of functionality your CRM users would benefit from. The built-in integration between Dynamics CRM 2011 and SharePoint 2010/Online removes much of the pain points mentioned above. Even though it may not cover all the customer document management scenarios directly (access rights, custom folder/site structures etc.), storing files in SharePoint document libraries instead of Dynamics CRM will automatically help you address many of the aforementioned issues related to content search, storage and editing. Also, the CRM SDK provides further extension points for SharePoint document management functionality development, combination with SharePoint’s extension points. You can see an example of such a scenario in this post on the CRM Consultancy blog.

    Thanks to the cloud version of SharePoint Online supporting Dynamics CRM integration starting from November last year, you can easily test the document management functionality in your existing Dynamics CRM 2011 / Online environment by signing up for an Office 365 trial account. With Office 365 E package subscriptions starting at € 7.25 per user per month, even if you’d use the whole subscription for nothing more than complementing the functionality of your CRM system, the cost wouldn’t be all that high, just 18% of a CRM Online subscription price.

    Better yet, if you sign up for Office 365 first and then later on purchase CRM Online, you’ll gain the luxury of using a single Microsoft Online login across both systems (see this post for the steps). Others will need to keep using Windows Live ID for Dynamics CRM until the transition to a single platform on Microsoft’s end has been completed sometime in the future.

  • Office 365 launches without Dynamics CRM integration for document management

    Office 365 launches without Dynamics CRM integration for document management

    Today was finally the big day when Microsoft’s cloud productivity platform BPOS was replaced with Office 365, which is now available for subscription. Having played with the beta version for a while now, I’m overall quite impressed with how close the SharePoint Online environment now is to its on-premises counterpart. While the limitations are still somewhat more visible than when comparing CRM Online vs. CRM 2011 on-premises versions, I think it’s already close enough to enable a significant part of traditional business requirements for SharePoint to be fulfilled with the cloud platform.

    Microsoft confirmed already last fall that also Dynamics CRM Online will eventually be migrated onto the same Online Services Delivery Platform as Office 365. In addition to being a natural fit with SharePoint and Exchange, CRM Online should also gain benefits into both its subscription management as well as authentication options as a result of  this migration. However, there’s no official timeline or feature set communicated yet, so we’ll have to keep waiting possibly until Q4/2011, when the next update for Dynamics CRM has been scheduled to become available, as announced in the latest Statement of Direction document.

    Ever since Dynamics CRM 2011 was launched with built-in SharePoint document library integration, there’s been a bit of anxiety on when this functionality could be leveraged with the cloud versions of CRM and SharePoint. Since BPOS was built on SharePoint 2007, it wasn’t possible to utilize the Microsoft Dynamics CRM 2011 List Component for Microsoft SharePoint Server 2010 in the Online environment. This meant that setting up a document management enabled trial environment with CRM Online required an on-premises SharePoint server, which wasn’t too convenient. Nor was it for any customer looking to go “all in” with their MS applications. Oh well, but now that Office 365 is available, that’s all a thing of the past, isn’t it?

    Wrong! Despite of the better together marketing message surrounding Office 365 and CRM Online, there’s actually still no way to integrate the SharePoint document libraries with the CRM List Component. Sure, you can upload the solution file into a SharePoint Online site and publish it. What you cannot do in the Online version is to take care of the second part of the installation steps, which involves the AllowHtcExtn.ps1 PowerShell script,used for enabling .htc file extensions to be served from SharePoint.

    Why is this important? Because without the .htc support, you can’t actually do anything with the document library. The folder creation can be configured and it flows through as it should when accessing the Documents menu for a new record, such as an account. However, after that you are presented with the following prompt:

    “The action buttons are disabled because the SharePoint server that you are using does not allow HTC component files. To enable the buttons, contact your system administrator.” What this means is that the document library will be rendered nicely inside the CRM entity form, but you can’t upload any documents to it. Clicking on the buttons does nothing, as they’re all disabled.

    How about on the SharePoint side of things then? We can see that the entity specific document libraries are created and also the corresponding folders for each record where the document location has been defined. We can also of course use the native SharePoint UI to upload documents into the library.

    Then when you access the corresponding record through CRM, you can see that the document does appear in the library. But with all the controls disabled, you again cannot do anything with it, like open the document, for example. How nice…

    How did we end up in this situation where the latest and greatest cloud offerings from Microsoft are not working together like they obviously were inteded to? That’s a very good question. The problem with Office 365 SharePoint Online limitations and their implications to Dynamics CRM document management functionality has been a known issue throughout the whole beta phase of Office 365. There are several threads on the Office 365 community forums regarding this. Yet the response from Microsoft has been that this cannot be resolved by GA (general availability) of Office 365 (as in “today”), but rather we’ll have to wait for the first service update, probably. Come on! How can 6 months not be enough to allow one .htc file to perform its work and provide the document integration between CRM and SharePoint? I find it extremely strange that the product management behind Office 365 has allowed such a flaw to be included in the initial release version.

    Of course eventually this issue will be solved and we’ll be able to experience the full document management process flow with Microsoft’s cloud applications.