0

CONDITIONS FOR MAKING A BUTTON SHOW

I want a button to appear selectively by using "Display field only, if". The field is in a Media record, attached to a Leader record (1 leader connects to n media). My condition is that a certain image field contained in the Leader record contains an image (isn't blank). How do I script that...?  TIA.

12 replies

null
    • David
    • 5 yrs ago
    • Reported - view

    Sorry, addendum. The image that appears in the Leader record is actually in a function field, not an image field, with the image called up from a separate Image record.

    • Peter_Smith
    • 5 yrs ago
    • Reported - view

    You could do this simply with the following in the Display field only if (for the button):

     

    Leader.'Image Formula'

     

    Where 'Image Formula is what you refer to as the "function field" in the Leader table.

     

    Hope this helps?

    • Database Consultant
    • Kirkness_Associates_Ju
    • 5 yrs ago
    • Reported - view

    That response was actually from me (Julian) - I was logged in as a test user...

    • David
    • 5 yrs ago
    • Reported - view

    Thanks, Julian. Brilliant - that's really simple. What would the script be if I wanted to specify the field as "blank" rather than "not blank"?

    • Database Consultant
    • Kirkness_Associates_Ju
    • 5 yrs ago
    • Reported - view

    Hi David - just put not in front of it:

     

    not Leader.'Image Formula'

    • David
    • 5 yrs ago
    • Reported - view

    Thanks, Julian!

    • David
    • 5 yrs ago
    • Reported - view

    Sorry, one more!  What script on a button in a Media record will open the associated Leader record?  I have:

    let myID := LEADER;
    closeRecord();
    openRecord(record(LEADER,number(myID)))

    ... but sometimes this seems to close the Media slide-in without loading the Leader slide-in, and I'm not sure why.

    • Database Consultant
    • Kirkness_Associates_Ju
    • 5 yrs ago
    • Reported - view

    Hi

     

    Assuming your media record is linked to the Leader record using a field Leader then:

     

    popupRecord(Leader)

     

    This will open the Leader record without closing the Media record - as a slide in as you call it.

     

    However, do you need to do this - simply clicing on the Leader field will do the same thing.

     

    Julian

    • David
    • 5 yrs ago
    • Reported - view

    OK, thanks, Julian. Yes, the short cut is fine for me, but my editing team needs something simple and obvious!

    • David
    • 5 yrs ago
    • Reported - view

    Julian, is there a condition that tracks if a record is already open?  "Do not display this buton [in Media record] if the Leader record it opens is already open?" Otherwise my editors are going to get into a muddle piling up records on top of one another. 

    • Database Consultant
    • Kirkness_Associates_Ju
    • 5 yrs ago
    • Reported - view

    You could just use:

     

    openRecord(Leader)

     

    this will open the Leader record (and go to the Leader table). The downside is that it will close the Media record.

    • David
    • 5 yrs ago
    • Reported - view

    OK, thanks, Julian. 

Content aside

  • 5 yrs agoLast active
  • 12Replies
  • 2620Views