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.

29 replies

null
    • Mel_Charles
    • 1 yr ago
    • Reported - view

    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 !

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      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 }
      ---
      
      • Mel_Charles
      • 1 yr ago
      • Reported - view

      Jacques TUR 

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

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Mel Charles What message was sent back?

    • Be Legal Property Compliance
    • Katie_Rayner
    • 1 yr ago
    • Reported - view

    Thank you this code was very helpful :)

Content aside

  • 2 Likes
  • 1 yr agoLast active
  • 29Replies
  • 779Views
  • 11 Following