Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    337

    Help with Controlling Visibility of Fields using Variables

    I have a sheet that has two Many-To-Many Relationship fields. Only one field should show on the sheet - the particular MMR field that appears on the sheet should depend on the users actions. The scripting contains a line that either states [$status]=1 or [$status]=0 (I set this variable up as a 'global' variable since it appeared that this was necessary). On the 'Edit and Visibility' field for each MMR, the visibility is controlled by a rule - either [$status]=1 or [$status]=0. This works well in theory; however, it does not work within the program. When I step through the scripting during debugging, the value of [$status] does change to 1 or 0 depending upon what actions the user chooses (just like it is supposed to) but this variable does not control the visibility of the MMR's.

    Does anyone know why controlling the visibility of the MMR's in the manner described above does NOT work?
    Thanks,
    Daryl G

  2. #2
    Join Date
    Jul 2012
    Posts
    87
    Create hidden 'Flag (yes/no) field'.
    In your script set it value to 1 or 0.
    Use this flag field in visibility rule of MMR field.

  3. #3
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    636
    Doing it the way MacHeuS said will work for sure as a field does refresh a state.

    However, if you want to do it the way you wrote it originally, then you need to add a single line to your script that refreshes the field state.

    See attached file for a working example.

    Regards
    James.
    Attached Files Attached Files

  4. #4
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    337
    James,
    It now works PERFECTLY!!!! In my case, I had to add two 'Refresh' commands (one for each of the MMR's). There was nothing in the manual about using the 'Refresh' button - how do you figure out these tricks?
    Thank you,
    Daryl G

  5. #5
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    636
    Excellent, I'm delighted that works for you.

    There was nothing in the manual about using the 'Refresh' button - how do you figure out these tricks?
    Your right. Seems that the manual says little to nothing about how this function works.

    I use WinWedge a lot to get brilliant database to talk to machines in factories, so the refresh function is something I've had to use a lot.

    Regards
    James

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •