As you may know, Microsoft is currently deploying a new type of field on your favorite CDS environments : the Files !
Currently, you have the possibility to create the fields and use them on Flow or Canvas App, there is no current possibility to use them on a model driven app form. That's where this control comes into the light !
There are 2 possibilities to use the control :
- with fields on the same entity (you can upload one file per field) - Left side on the demo
- with fields which are on a sub entity (you can upload as many files as you want !) - Right side on the demo
You can find the source code and the details of the control on my GitHub repo
You have the WebApi available calls to manage files.
In quick words, here is the process to upload the files to the File Field :
- Create the record hosting the file(s) (if it's not done yet)
- Choose the File from the input button
- Convert this file into Base64 format
- To Patch the record with the file, you need : FileName + FileContent into an ArrayBuffer
- Your data is available !
Configuration sample :
- For file in the same entity :
In that sample, my entity is
carfup_entitywithfile and my file field name is :
- For files in a sub entity:
In that sample, my parent entity is
carfup_entitywithfile, my sub entity hosting the files is
carfup_customattachmentand my file field name is :
In order to download the package, you can go to the release tab of the repo.
You will find the unmanaged/managed version of the solution and the source code too if you want to improve the control !
I hope you will like it and enjoy the work.
I wish you a great end of the year 2019.