Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need a trick to change field selection values

Posted on 2004-10-26
23
Medium Priority
?
599 Views
Last Modified: 2013-12-18
Hi All,

In a form, there is a field called Options: Checkbox, editable, formula for choices is AllOptions, and both Refresh fields and Refresh chocies are selected. The formula in the CfD-field AllOptions is
     @If(Options="Ma"; "Send as mail | Ma":"Send on Save | Sd"; "Send as mail | Ma")

What I want is that, if the user selects the Send as Mail option,  a second option is displayed, namely Send on Save. This works... almost, I only have to press F9 to make it show up.

Calling Refresh from the PostRecalc is illegal, but would be the solution if it weren't recursive. I already tried to put a GoToField("nextfield") in the Entering of the Options-field, but this effectively blocks the user from doing anything in that field. Which is by all means a great feature, but not for this purpose (equivalent to using InputEnabled, but works in R5 as well :).

How can I do this using more or less standard stuff? I think I know some ways around this, but your tricks are welcome!

Sjef
0
Comment
Question by:Sjef Bosman
[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
  • 9
  • 8
  • 3
  • +2
23 Comments
 
LVL 46

Author Comment

by:Sjef Bosman
ID: 12415279
I found, on the 3rd tab of the Field Properties box:
   Special Notes Client Event Options, Run Exiting/OnChange events after value change

1) Would this be a solution?
2) Does it exist in R5 (for compatibility reasons)?
0
 
LVL 14

Assisted Solution

by:p_partha
p_partha earned 75 total points
ID: 12416009
Did you enable "AUtomatically refresh fields" at the form level?...

Partha
0
 
LVL 46

Author Comment

by:Sjef Bosman
ID: 12416061
Hi Bro, as a matter of fact, I thought about writing that I didn't use that option, since I suppose it wouldn't make a difference since 1) it's not a refresh field that needs to be done, but a refresh choices, and 2) the refresh fields is already triggered because it is set on the field itself. I'll try tomorrow.

Thanks for thinking along, but I'm off, to a refreshment and some peanuts. And bed afterwards. All letters start to look identical, and I seemn to be unble to  fins the keyus on myu keibord. See ya! ;)
0
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!

 
LVL 15

Expert Comment

by:Bozzie4
ID: 12418608
" Run Exiting/OnChange events after value change" is R6 only.  I don't know if it has an equivalent in R5 (or maybe it's even standard in R5?)

What you could do is store the values not in the field itself, but in a separate field.  Now put code in the QueryRecalc to update this field BEFORE it will use this field's values to update the checkbox (is that clear ?)
When refreshing, (I hope that) first the field with the values will be updated thru the QueryRecalc event, and then the checkbox will be updated with this field's values ....

cheers,

Tom
0
 
LVL 46

Author Comment

by:Sjef Bosman
ID: 12419308
Using QueryRecalc would be one of the ways around the problem, but it is "New with R6" says the Help db. So I had already skipped it. The hard part is that a PostRecalc is too late, since field choices are refreshed before that when the field with the choices still has the old values. An additional Refresh would do, but how to trigger it? Preferably without my favourite object (a NotesTimer, indeed!).

Must be a hard nut to cra(c)k this one...


0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12420719
What about the "Old Fashioned Way"?

-- an Options1 field, editable checkbox, with only one choice <<Send as mail | Ma>> and Refresh fields on keyword change
-- an Options2 field, editable checkbox, with only one choice <<Send on Save | Sd>>  and Refresh fields on keyword change, and Hide when <<Options1 != "Ma">>
-- an Option field, computed, with formula <<@Trim( @If( Options1 = "Ma"; Options1:Options2; Oprions1 ) )>>

0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12420756
You can make the two formulas relative (better) if Hide when is <<Options1 = "">> and Options is <<@Trim( @If( Options1 != ""; Options1:Options2; Oprions1 ) )>>
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12420778
oops, a typo, this one is OK <<@Trim( @If( Options1 = "Ma"; Options1:Options2; Options1 ) )>>
0
 
LVL 46

Author Comment

by:Sjef Bosman
ID: 12420994
I seem to remember vaguely that I myself sugegsted something like this not so very long ago. Without the typo's...

It is indeed a possibility, and probably the only left that can be called "more or less standard". That there are additional fields is not a huge problem, but an important disadvantage is that I get into trouble when I have the field(s) displayed with the choices in 2 columns or when there are more choices than the two I used for the example. So I will have to place the fields on separate lines (which is also required to make hide-when work, unless I place them in separate table-cells.

Best suggestion so far :)
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12422939
well, the sentence <<Old Fashioned Way>> was clearly a citation from sjef_bosman's contribs to this site ;-)
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12423092
the solution I gave above can be extended easily to multiple groups of options, as follows

-- Options1: checkbox editable, Refresh fields, Allow synonyms, Enter choices
option 1 | opt1
option 2 | opt2
option 3 | opt3
option 4 | opt4

-- Options2: checkbox editable, Refresh fields, Allow synonyms, Refresh choices, Use formula
opt1 := "option 1.1 | opt11":"option 1.2 | opt12":"option 1.3 | opt13";
opt2 := "option 2.1 | opt21";
opt3 := "option 3.1 | opt31":"option 3.2 | opt32";
opt4 := "";

@Trim(
 @If( @Contains( Options1; "opt1" ); opt1; "" )
 : @If( @Contains( Options1; "opt2" ); opt2; "" )
 : @If( @Contains( Options1; "opt3" ); opt3; "" )
 : @If( @Contains( Options1; "opt4" ); opt4; "" )
)

-- Options: Text computed, Allow multiple
@Trim( Options1 : Options2 )

0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12423347
a little better, if we extract the Options2 formula for choices in a new AllOptions2 multivalue, always hidden, CFD field, then we can have the following "hide when" formula for Options2 that works fine: <<Options1 = "" | AllOptions2 = "">>
0
 
LVL 15

Assisted Solution

by:Bozzie4
Bozzie4 earned 75 total points
ID: 12424481
Darn... I though I had it with the QueryRecalc :-)

Back to old-school antique notes programming :-)
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 12424761
If AllOptions is above Options, it will work.  That's the reaosn you needed the extra refresh.

Want to prove it?

Create -> Design -> Form

Create -> Field

Name it AllOptions, computed for display, allow multiple values, formula      @If(Options="Ma"; "Send as mail | Ma":"Send on Save | Sd"; "Send as mail | Ma")

Press Control-End

Press Enter

Create -> Field

Name it Options, Checkbox, Refresh on keyword change, Refresh choice on doc refresh, Formula for choices -- AllOptions

Design -> Preview in Notes

Works like a charm.
0
 
LVL 46

Author Comment

by:Sjef Bosman
ID: 12424937
But... That's how it is in the form! I'll check again, don't worry. Maybe I'll create a test form, to try it out. Could it be that the order of creation is important?
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 12427247
Order of creation should be irrelevant.
0
 
LVL 46

Author Comment

by:Sjef Bosman
ID: 12446326
Apparently the choices are refreshed BEFORE the form is refreshed. Makes sense, for the content of the field might have to be adapted to the choices that are allowed. Anyway, it doesn't work as described above :(

I even had the Choices-formula in the Options field itself, didn't work.

YOU AIN'T GONNA BELIEVE THIS! :-)

I cracked it, but don't tell me please that you knew all along! The solution is absolutely mind-boggling: I added a simple formula in the Input Translation of the Options field, namely... Options. I reckoned: Options had its old value when the AllOptions field was re-evaluated, so I had to force to compute Options before that. I assumed the Translation formula could just be doing that, and BINGO!
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12446453
BRAVO
0
 
LVL 31

Assisted Solution

by:qwaletee
qwaletee earned 150 total points
ID: 12475711
Sjef,

I did not need to do the Translation Formula bit in my minimalist test.  On 5.0.11, everything worked like a charm exactly as I described it.

What version are you using?
0
 
LVL 46

Author Comment

by:Sjef Bosman
ID: 12476967
6.0.3

I didn't create a new form and field yet, I'm just too happy that it works now. Well, let's test it rightaway...
Nope, doesn't work, the CfD field has the correct values, but the checkbox doesn't have all the choices. If I change the Translation formula... Like Magic!!

I wouldn't  know if this behaviour is corrected in 6.0.later or 6.5.something. Maybe someone else can test this? Tom??
0
 
LVL 3

Accepted Solution

by:
Andrea Ercolino earned 150 total points
ID: 12477063
I tested it on 6.5.1 and it didn't work as described by qwaletee
0
 
LVL 46

Author Comment

by:Sjef Bosman
ID: 12480818
Thanks RAPUTA. So we have a new Notes "feature" indeed, to be added to the long list!  Yeaaah! :)

Any news on 6.0.4 or 6.5.latest?
0
 
LVL 46

Author Comment

by:Sjef Bosman
ID: 12704156
PAQ/Refund would have been "right", since I found the solution, but I decided to give the points for your efforts in assisting me during some "difficult" hours. Thanks!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

610 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