Go Premium for a chance to win a PS4. Enter to Win


Hide-When question

Posted on 2003-12-02
Medium Priority
Last Modified: 2010-04-22
I'm having a problem developing a hide-when formula.
I'm trying to hide part of a rich-text field called [Subtable] but in only one situation: when field [RequestStatus] = "New" AND When the document is being printed.
This field Contains a table that, for one or more cells, contains another table. this Subtable is what i am trying to hide.
possible values and states:
1. [RequestStatus]="New", Document being Read --> Show [Subtable]
2. [RequestStatus]="New", Document being Edited --> Show [Subtable]
3. [RequestStatus]="New", Document being Printed --> Hide [Subtable]
4. [RequestStatus]="In Process", Document being Read --> Show [Subtable]
5. [RequestStatus]="In Process", Document being Edited --> Show [Subtable]
6. [RequestStatus]="In Process", Document being Printed --> Show [Subtable]
7. [RequestStatus]="Complete", Document being Read --> Show [Subtable]
8. [RequestStatus]="Complete", Document being Edited --> Show [Subtable]
9. [RequestStatus]="Complete", Document being Printed --> Show [Subtable]
Thanks for your help
- Todd
Question by:irontodd
  • 3
  • 2
LVL 13

Expert Comment

ID: 9865614
RT fields always cause undisired side effects on hide when formulas since they store the hide computations.
Usually it helps when RT fields are stored in a computed subform (in condition X show "A", otherwise show "B"...), but in this case..... :-((
The hide when printed option is only available as checkbox. There's no function to evaluate, like @IsDocBeingEdited. That means that its hard to combine with other formulas as a logical AND. All is does is OR: hide is <checkbox> OR <formula>. And worse: if a user presses CTRL + P, you'd probably need a refresh and once loaded, you can't change the computed subform, unless the document is re-openend.
In short: sorry, but I'm afraid there's no way!

Unless.... (meanwhile another hour has passed!)
If you split your RT field in three to lift the middle part (the subtable) out. Put #1 and #3 on a for just as you have your RT field right now.
Make a computed subform: @If(RequestStatus="New"; "SubtableHide"; "SubtableNormal")
Place a section on "SubtableHide" with the actual subtable (RT field #2?) in it. Place the hide when printed checkbox on the section header. If the header is hidden, the entire section + content will be hidden.
If you change status, you'll need to re-open the document. People will grow over that!
With the right subform loaded, the hide switch is available. The other subform lacks the hide option. The RT field itself contains no hide options to avoid any side effects.
Please let me know. I never tried this one! It might take a week or two until I can....

Author Comment

ID: 9866590
I appreciate your feedback. Unfortunately, I dont think the second method you provided is really feasible in this case, because the subtable in question is repeating, anywhere from 1 to 100 times.
basically it's populated into EVERY cell in the last column of the main table. The main table and the subtable will also be different for every document. Well, the format will always be the same, but the data in the tables will be different. What i'm doing is actaully pulling an RTField from a template in another document when the doc is created, then expanding the main table and copying the subtable into all the necessary cells.
Now, I have almost found a workaround, but something's a little strange with this as well. Maybe you can answer this one. I've written the following code to "simulate" my original question

FIELD PrintSubTables:=PrintSubTables;
@If(TestCompleteStatus="New Request";@SetField("PrintSubTables";"No");@SetField("PrintSubTables";"Yes"));

the only problem with this is that when the "script" get to the last line, it pops the "do you want to save" dialog. I cant figger out why.
Thanks again for your comments, and any further help is greatly appreciated.
LVL 13

Accepted Solution

CRAK earned 1000 total points
ID: 9867128
Ha ha ha.... that one keeps puzzling people!

Some commands aren't always executed in the same order as they were programmed, but always shifted to the end of the code. [FileCloseWindow] and [FileSave] are two of them, but [EditDocument] isn't.
So what happens is that you first want to set the document to readmode (where the pop-up shows), and then the save is forced.

Back in R3 ALL commands were postponed like that. The only way to get around it was by wrapping them up in a normal @-function:
   @Do( @Command([FileSave]) )
R4 and later executed the @Commands as natural as posstible (with these exeptions). To force them in R3 order (i.e. postpone all @Commands) the @PostedCommand was introduced. @Commands are still executed in their programmed order while @PostedCommands (and the exceptions) are thrown to the end of the code.

Both offer possible solutions to your problem:

@Do( @Command([FileSave]) );



(mind the ";" after the save!)

Author Comment

ID: 9867357
Well, you were Close.. My R5 didnt exactly like either of your options.. I actually had to:


but hey, I appreciate it.. I had totally forgotten about those two comands.. My notes is a bit rusty.. I've been out of it for about 2 years.. and only had about a year worth of experience when i quit..

You've been a great help! Thanks!
LVL 13

Expert Comment

ID: 9869269
That's odd... I had them both working! In R5.
Anyway... good luck! Hope you'll get something going nicely there.
Thanks for the points!

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question