Tip #1366: Make file type field required

We recently got a great new field type in CDS called the file type field. This allows creation of fields that contain files, and it is very useful for scenarios like the following:

  • Order needs to have a copy of the purchase order before the order can proceed
  • application must include a copy of applicant’s driver’s license

In the past our only options were to put the file in attachments or Sharepoint, both of which are 1:N file storage mechanisms. So while we could handle files, we couldn’t dependably verify that a specific file had been supplied.

With the file field I can tell that a file has been added if the “purchase order” or “driver’s license” field contains data. Super.

But how do I make the field required? None of the normal requirement tools can work with file fields. This is likely due to the file being stored in Azure Blob. You can’t require it at the field level, and you cannot require it with a business rule, and you cannot check if it contains data via workflow.

Use business process flow

In most cases like I listed above, the file is required before reaching a specific stage in the process. Use business process flow and make the field required in the process flow. This makes the field required before changing stages or completing the process, but doesn’t make the field required to create or update the form.

Cover photo Nora Belrose / CC BY-SA

5 thoughts on “Tip #1366: Make file type field required

  1. Dorthe Mogensen says:

    This is great to know!

    I got a case where we would like to use the file field for sentisive date. Do you know if this fields follows the normal security model?

    And do know how to add to regular form?

  2. saad nadir says:

    i am having a question please, under D365 online, can we retreive the file in fetchxml request ? the final goald is to use the file image as a signature in SSRS reporting.

  3. Keith says:

    I have a BPF with File columns as described above. However some users, who have been assigned a new Security Role, aren’t able to upload files – the ‘Browse’ button is greyed out. They can write to all other columns, and create and edit records as normal, just not the File columns.

    Do you know what option in the Security Role permissions I’m missing to allow this?

Leave a Reply

Your email address will not be published. Required fields are marked *