Expand all | Collapse all

Collapsible Square in a Table

  • 1.  Collapsible Square in a Table

    Posted 07-10-2018 21:42

    I'm creating a table for projects that has a Comments field that is is going to be _very_ long, and I was wondering if there was a way to make this field collapsible. Meaning, that if the comments are  very long, to reduce the field to a preview. And there should be a arrow that the user can click on or some button for them to expand the field if they want to read all the comments for that project. 


  • 2.  RE: Collapsible Square in a Table

    Posted 07-10-2018 22:17
    I use this:

    If(Length([Notes])<180,[Notes],Left([Notes],180)&"...<br><a href='"&URLRoot()&"db/"&Dbid()&"?a=dr&rid="&[Record ID#]&"' title='" &
    List("&#39;",Part([Notes],1,"'"),Part([Notes],2,"'"),Part([Notes],3,"'"),Part([Notes],4,"'")) &

    I use this for building fields to use in reports.  It allows the use to see a pre-fixed number of characters (you can change it from 180) with a "more" link which when you hover on it will display the entire field value.  If the use clicks on the "more" link; it will open up the record.

  • 3.  RE: Collapsible Square in a Table

    Posted 07-10-2018 22:23
    Thank you! However, where do I do this? Do I go to Reports and Charts and make a new report? I just need some clarification or steps on where to put this code. Because the field has already been created,

  • 4.  RE: Collapsible Square in a Table

    Posted 07-10-2018 22:25
    You have to build a formula-rich-text field and the [Notes] field name in my formula needs to be replaced with your data-entry text field name.  I usually name the field [Notes (for Rpts)] or something like that, so I can easily identify them from the data-entry fields.  Then you can substitute the [Notes] entry field in reports for the formula field instead.

  • 5.  RE: Collapsible Square in a Table

    Posted 07-10-2018 23:01
    Great! I've put in the formula but have run into this message:

    "A formula may not contain a reference to itself directly or indirectly through another formula."

    So for the notes, I switched it in for "Comments" but I'm guessing that's wrong? I reread your last comment but not sure what to put in for Notes.

  • 6.  RE: Collapsible Square in a Table

    Posted 07-10-2018 23:03
    What is the data-entry field name that your Users enter their notes/comments into.  That's what you need to use where I have [Notes].

  • 7.  RE: Collapsible Square in a Table

    Posted 07-11-2018 16:06
    The field name is COP Comments #3 where my user is putting all their comments. However when I keep substituting it COP Comments #3 for Notes, it gives me a warning saying that  I can't use that field and that instead I have to my other fields that are Text only fields.

    However, I've tested it out a different way that does work but has some issues. I decided to make another field called "Notes" and in the square brackets I put in the "COP Comments" which is a Text-Multi and it works. The "Notes" field now hides comments until the user clicks on more. 

    But the issue is that not the user will have to input the comment in another field and have what they have written in two fields, one that will be fully expanded and the other that is hiding it. This can confuse the user if we are making them input in one field and have it appear somewhere else

  • 8.  RE: Collapsible Square in a Table

    Posted 07-11-2018 19:19
    Is your COP Comments #3 a multi-line rich-text field?

  • 9.  RE: Collapsible Square in a Table

    Posted 07-11-2018 21:24
    Before I made the "Notes" field and added the code, it was a formula multi-line where I was trying to add the code there, but after creating the "Notes" I restored it to Text multi-line

  • 10.  RE: Collapsible Square in a Table

    Posted 07-11-2018 16:45
    To get the most efficient use of screen real estate I would use script. This example could easily be modified to display the lengthy comments rather than the related child records:

    Subdatasheet ~ Click on Plus Sign To Expand Children

    Another option would be to use script and popup a dialog box. Perhaps you can draw inspiration from one of these dialog demos contained in this post:

    How To Dialog?