D
|
david22585 6/3/2023 |
Is this a list page or view/edit page? I assume that the tables are joined, and the query pulls the limit_count total on the page as well. If it does, create an alias of the file field as say 'file AS filelimit', Set the filelimit as custom, with text saying File download limit has been reached for the day. Put that in the same column as the file. Then on the After Record Processed Event: if ($data["limit_count"] > '5'){ This way for each row, it will only show one field vs the other depening upon the limit. |
T
|
technoserv author 6/4/2023 |
Hello david22585 and thanks for your reply. Your approach completely hides the field and its contents. |
D
|
david22585 6/4/2023 |
I'm a little confused as to what you want, as you stated "Another solution I thought of was to change the field parameters from type "file" to "text" with a custom setting but I'm having trouble with the code." This code effectively does that. It shows the file download if there is less than 5 downloads already, but if there is more than 5, then ithides the download, and the alias field with the custom text is shown. You're duplicating the field, but showing 1 vs. the other. Do you want the file to still be there, but you can't click the link to download it? Or just have text that the file download limit has been reached? |