Show factbox fields depending on values in field

MGoosenMGoosen Posts: 5Member
Hello everyone,

I'm trying to make the fields in a factbox visible/not visible depending on the values in the source table.
For example; if the source code is "extern", the field should be visible in the factbox and otherwise the field shouldn't be.

I created boolean global variables and set those in the Visible properties of the fields and I set those global variables to FALSE in the OnInsert trigger of the factbox. Next I put code in the OnAfterGetRecord trigger of the factbox to set the variables to TRUE depending on the condition (with a CASE statement).
Right now all fields are not visible, so the code in the OnInsert trigger works. But the code in the OnAfterGetRecord isn't and I don't know how to proceed.

Is it possible what I'm trying and if so how can it be done?

Thanks anyway.

Comments

  • nicolassaleronnicolassaleron Posts: 11Member
    Hello,

    Have you tried to put your code in the OnAfterGetCurrRecord?
  • HatchetHarryHatchetHarry Posts: 24Member
    edited 2019-02-11
    put them in a group and the set the visible on the group. And make sure the boolean is true in the OnInit.
  • MGoosenMGoosen Posts: 5Member
    Hello,
    No, not until you suggested it.
    Unfortunately, it doesn't work either.
  • BlackTigerBlackTiger Posts: 1,226Member
    You can't show/hide individual fields in CardPart fact-box, this property works only for groups of fields.
    "You can’t just ask customers what they want and then try to give that to them.
    By the time you get it built, they’ll want something new.” Steve Jobs
  • BlackTigerBlackTiger Posts: 1,226Member
    But you can create a factbox based on temporary table containing FieldCaption/FieldValue pair and populate it dynamically. Similar to item attributes.
    "You can’t just ask customers what they want and then try to give that to them.
    By the time you get it built, they’ll want something new.” Steve Jobs
  • MGoosenMGoosen Posts: 5Member
    The combination of putting the fields in a group and setting the visible on the group with putting the Case statement in the OnAfterGetCurrRecord trigger did the trick.

    Thanks for the help everyone.
Sign In or Register to comment.