irontodd
asked on
Hide-When question
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
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"
8. [RequestStatus]="Complete"
9. [RequestStatus]="Complete"
Thanks for your help
- Todd
ASKER
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:=PrintSubTa bles;
@If(TestCompleteStatus="Ne w Request";@SetField("PrintS ubTables"; "No");@Set Field("Pri ntSubTable s";"Yes")) ;
@Command([RefreshHideFormu las]);
@Command([FilePrint]);
@SetField("PrintSubTables" ;"Yes");
@Command([RefreshHideFormu las]);
@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.
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:=PrintSubTa
@If(TestCompleteStatus="Ne
@Command([RefreshHideFormu
@Command([FilePrint]);
@SetField("PrintSubTables"
@Command([RefreshHideFormu
@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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Well, you were Close.. My R5 didnt exactly like either of your options.. I actually had to:
@Do(@PostedCommand([FileSa ve]));
@PostedCommand([EditDocume nt];"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!
@Do(@PostedCommand([FileSa
@PostedCommand([EditDocume
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!
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!
Anyway... good luck! Hope you'll get something going nicely there.
Thanks for the points!
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....