Solved

Hide-When question

Posted on 2003-12-02
5
254 Views
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
0
Comment
Question by:irontodd
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:CRAK
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....
0
 

Author Comment

by:irontodd
ID: 9866590
CRAK,
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

@Command([EditDocument];"1");
FIELD PrintSubTables:=PrintSubTables;
@If(TestCompleteStatus="New Request";@SetField("PrintSubTables";"No");@SetField("PrintSubTables";"Yes"));
@Command([RefreshHideFormulas]);
@Command([FilePrint]);
@SetField("PrintSubTables";"Yes");
@Command([RefreshHideFormulas]);
@Command([FileSave])
@Command([EditDocument];"0");

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.
0
 
LVL 13

Accepted Solution

by:
CRAK earned 250 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]) );
@Command([EditDocument];"0");

or:

...
@Command([FileSave]);
@PostedCommand([EditDocument];"0");


(mind the ";" after the save!)
0
 

Author Comment

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

@Do(@PostedCommand([FileSave]));
@PostedCommand([EditDocument];"0")

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!
0
 
LVL 13

Expert Comment

by:CRAK
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!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now