Support Portal ContactGet in touch

DocMan Day Three: Opportunities and Bucket Folders

   Words by Paul McQuillan

   on 24/11/2019 11:00:00

We have seen how DocMan can create new Document Libraries and Folders to records in Dynamics, and how related records can form the structure for how our documents are stored.

We can also look at the concept of ‘bucket’ folders that can build not just a Folder for a Record, but also other ways of dividing record’s document locations into logical types or sub-divisions.

So we could potentially divide how we store the Documents for Opportunities or Cases by the Type of Opportunity,  or by the Month or Year when the Opportunity was created – this helps keep our Document Structures manageable and governable, and avoid the problem of having a single big long list of Folders that can make navigation more difficult.

Before we look at how this is done for Opportunities in the initial DocMan Configuration, we can actually see this concept in the definition of the earlier Account Entity.


Here we can see the top DS3 Rule defining a ‘bucket’ location to use before the DS4 Rule then creates a Folder per Account.

Drilling down into this rule gives us a basic definition to use or create a Document Library in SharePoint as the bucket, and that this Document Library should be created with a simple fixed title of ‘Client Documents’.


Looking at Opportunities, we can see this in evidence with each Opportunity we open.

Picking an Opportunity and clicking LOCATION in the DocMan Panel or the Dynamics Documents List will show us the following way we have defined Folders for Opportunities to be created:


We can see that the Opportunity’s Document Location is being built via:

1. DS2 - Parent Rule looking up to the Folder for the Company Account

2. DS3 - Bucket Rule defining that all Opportunity Folders should be tracked in a fixed folder for ‘Opportunities’

3. DS4 - Record Rule adding a new Folder for each Opportunity

This structuring is available in the DocMan Entity definition for Opportunity – as we can see our respective three rules in the definition:


This is a similar ‘fixed’ bucket to put our Opportunity Record Folders in.

However we can change this to start using a non-fixed Bucket Folder that would instead depend on a Field in the Opportunity record itself – so say we wanted to model the scenario where our Opportunities were sub-divided by the Currency involved in the Opportunity, then we would amend our Bucket Rule to create a Folder based on the ‘transactioncurrencyid’ field of the Opportunity.

To do this, we would change the [Map Type] from ‘Fixed Mapping’ to ‘Field Mapping’, and set the [CRM Field] to the Database Name of the Field we want to use.

We can also reset the [Template / Fixed Value] to use the CRM Field we want to bring in – so we can set this to ‘{0} Sales’ as way of using the value of the Currency Field and then following with Sales so the resulting Folder is clear.

The [Data Type] we can leave as String in this incidence, as this will simply ask DocMan to interpret the Lookup Text of the Currency Field using its Text/String definition:


NOTE: This type of mapping and choosing whether to use the Value or Text of the Field can be done for Option Sets, Lookups, Dates or any other type of Field we track within Dynamics.

With this in place in the DocMan Configuration – we can see this in action.

If we create a New Opportunity and set the currency to ‘US Dollar’, we will see this reflected in SharePoint as {Account Name} >> US Dollar Sales >> {New Opportunity Name}


This gives us a way of sub-dividing groups of Opportunities within the structure of the Parent Customer Account – if this is useful to us.

This concept of a Dividing Folders or Document Libraries by a Bucket can be put to use in a variety of scenarios to help ensure we get the structure of Document Management right between our Records in Dynamics and SharePoint.

Do Changes to the DocMan Configuration take effect immediately?

Yes – DocMan does a range of caching behind the scenes, but refreshes this cache when a change is recorded to the DocMan Entity or Rule records.

What happens to existing Records and SharePoint Folders?

Nothing happens for already existing records – any rule changes in DocMan update the logic for new records being added to Dynamics, but do not change existing records.

This is to keep the consistency of existing Links and SharePoint Locations even when the Rules change; and corresponds to how Dynamics stores the Document Locations to associate Records in Dynamics to SharePoint Locations.

This gives an initial view of Bucket Rules to work in tandem with Record Rules, we will see this again when looking at the Case Entity in the initial configuration from the DocMan Wizard and how this uses the Date of the Case as a Bucket Rule.

However we will next look at Content Types in DocMan, and how we can divide Documents for an Opportunity between a commonly defined set of Content Types.

But before we do, it may be useful to reference a quick guide for how records in Dynamics can be renamed to update the Location in SharePoint.

  • "Paul has made a real difference to how my team of 24 people record and store valuable customer data and sales opportunities. Highly recommended."

    James, Operations Director

  • "Understanding your business allows us to advise when to implement aspects of CRM and, likewise, when not to."

    Paul McQuillan, Managing Director

  • "Dynamics 365 and CRMCS have made a real lasting difference to our business, allowing us to replace older systems that were holding back our performance."

    Grahame, Chief Operating Officer

  • "James worked well with us to help connect CRM with Outlook and relate how this might benefit our team using CRM for Property Care."

    Natalie, Property Care Supervisor

  • "Matt was really good with helping us run User Testing on the new Compliance Module of our CRM System."

    Tom, Compliance Administrator

Prefer to go old-school?

Write to us using the below addresses.

Head Office
CRM Consultancy
61 Oxford Street
M1 6EQ

London Office
CRM Consultancy London
Grosvenor Avenue

Content © CRM Consultancy.