2

Comments icon hi-lite like Attachments.

In another post wrt hiliting the paper clip this code was advised:

if count(files(this)) != 0 then
html("
<style>
.i-light-grey.i-attachment {
background-color: #a9a9a9;
border-radius: 4px;
}
</style>
")
end

So - are there any boffins out there that can tweak this code snippet to do the same for the Comments icon that lives next to the paperclip?

Comments is such a handy feature but I suspect underutilised (apart from developers perhaps) for keeping notes for records.

29replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi Jaques

    I had a way of listing the files count and colouring the paperclip icon, but of course like many others could not get at the comments area. 

    Your solution is neat and well executed and I have already taken advantage of it (noting that it might fall apart if Nixon do their thing on the software!)

    I'm on cloud version and it works a treat

    Very useful and practical !

    Like
    • Mel Charles here is an example that uses NativeJS to count the number of files in the current record. Put this code in a formula to see the result.

      var t := this;
      var nbFilesInFields := #{:number
                              // Returns the number of fields that are of type 'file' (image) and that are filled.
                              return Object.values(database.schema.typeOf(t.id).fields).filter( f => (f.base=='file' && t[f.caption])).length;
      }#;
      var nbFilesTotal := count(files(this));
      var nbAttachedFiles := nbFilesTotal - nbFilesInFields;
      ---
      files in fields : { nbFilesInFields },
      Attached files : { nbAttachedFiles },
      Total files : { nbFilesTotal }
      ---
      
      Like
    • Jacques TUR 

      I tried it, but editor don't like it for some reason

      Like
    • Mel Charles What message was sent back?

      Like
    • Katie Rayner
    • Be Legal Property Compliance
    • Katie_Rayner
    • 1 mth ago
    • Reported - view

    Thank you this code was very helpful :)

    Like
Like2 Follow
  • 2 Likes
  • 1 mth agoLast active
  • 29Replies
  • 528Views
  • 11 Following