Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Hide-When question

Posted on 2003-12-02
5
Medium Priority
?
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 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]) );
@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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

705 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