I have a field that is a "File" type, and I had it set it up with Column Security Profile so that a user could "create" but not "update". Ideally, users should be able to upload the file the first time but then not be able to delete it.
The problem is that a File type field does not permit uploads until the record is saved the first time (i.e. when the form is in Create mode).
As a developer, the way that column security used to work (to my way of understanding) was that the "create" permitted a user to populate a field, and it was not related to the mode of the form. Now that seems to have changed; Column Security Profile no longer permits a File type field to support the ability "create". Now my users create a record, save it, but they do not have the ability to upload the document because the form is in "update" mode.
What you found is correct, the File attribute requires that the record is saved first (similar way as it happens with activities). In this scenario FLS will not help you. Probably the easiest way to solve this kind of requirement (let's simplify it with "the user can only upload the first time and not update/delete it") is to create a plugin (probably with a specific security role to act as placeholder for the users that need to have this rule). The user technically will have the right to update/delete the file but the plugin will stop these actions after the first upload.
hope it helps
I checked some of my older on-prem, clients and you are right that FLS has not changed. The "File" data type has not been around since 2011, and I have worked with this system since CRM 3 was released. More importantly though, my point is that there is a logic problem in that a File type field does not permit its value to be set while the form is in 'create' mode (obviously because there is no GUID for a "Regarding" to relate to) and if the user has the Update FLS permission on that field in order to initially upload a file, then they also have permission to click the "Delete" button and what my client does not want is the ability for users to replace an existing document with something else. I see a couple ways to handle this:
The above options are tedious, and could be avoided if we had FLS Create option for File type fields. Any other suggestions are open for discussion.
@eccountable wrote:
As a developer, the way that column security used to work (to my way of understanding) was that the "create" permitted a user to populate a field, and it was not related to the mode of the form. Now that seems to have changed; Column Security Profile no longer permits a File type field to support the ability "create". Now my users create a record, save it, but they do not have the ability to upload the document because the form is in "update" mode.
Pretty sure it has been the same since I've been working with it CRM 2011 - either way the behavior is as currently documented. Create in a Field Level Security Profile is the ability to add a value to the Field when creating the main record. Update, can make changes to the field value after the main record has been created.