Selecting all choices in dropdown

I have a field that is a single selection dialog list. It is the “Market” field. Depending on what “Market” is selected, my “Counties” field uses the “Market” as a key to a view @Dblookup to return all the “Counties” in that “Market”. So far so good.

But now I want to automatically have ALL Counties FOR THAT Market selected (i.e., can’t be set in the default formula). This could be quite a long list and I’d rather have the de-select the ones that may not be needed (usually the are all needed).

I’ve searched and found some attempts at solutions in this forum, but haven’t gotten any to work (most specifically an input translation using the @Select function as indicated in this entry:http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/e23bb6fe51bdc9ad852570f1006c1f72?OpenDocument) . And other strings in the forum end without a final solution. I’m not proficient with Lotusscript, but can usually modify examples to meet my needs.

Any ideas appreciated!

Subject: RE: Selecting all choices in dropdown

You want to respond to a change of the Market field by changing the value of the Countries field, and also changing the list of choices of the Countries field. Changing the list of choices can only happen with a formula, and requires a refresh of the form. So if you can do it all with a refresh of the form, you might do it that way – using only formulas.

For instance, you could have a CFD field, OldMarket, that stores the value of the Market field from before. You can compare this with Market to determine whether the field has changed, because you don’t want to replace the Countries value if the form is just refreshed without the field changing. A second CFD field, CountryChoices, can do something like:

@If(OldMarket = Market; @ThisValue; @DbLookup(…))

Now the input translation formula of the Countries field can do something similar:

@If(OldMarket = Market; @ThisValue; CountryChoices)

Subject: But my main issue is …

I want all the counties to show up in the dropdown list already selected…either checkmarked if a dialog list or X’d if it is a checkbox.

Subject: RE: But my main issue is …

Yes, that’s what the input translation formula is for. The way to check all the boxes is to assign the field to contain all the values.

Subject: Selecting all choices in dropdown

Client or Web?

Subject: Client

Client only.

Subject: RE: Client

So if I get this right… 2 fields. When changing a value in field A, field B recalculates its options and also puts these options in the field as a value.

You want this event to be triggered by Field A since changing anything in Field B has no update effect.

Domino simply doesn’t have a ‘onChange’ event for things like that on the client side.

What I would, create a form with a layout region, place Field A on that layour region.

On your own form, make a link/hotspot/button whatever and use something like:

Sub Click(Source As Button)

Dim db As NotesDatabase

Dim s As New NotesSession

Dim ws As New NotesUIWorkspace

Dim doc As NotesDocument

dim uidoc as NotesUiDocument

Set db = s.CurrentDatabase

Set doc = db.CreateDocument

//User get the popup to make his selction in Field A

if ws.DialogBox (“The Form with Field A”, True, True, False, False, False, False, “Dialog Box”, doc) = false then exit sub

//Here we know which value has been select.

//Do a lookup here to see what values should be present in Field B

uiDoc = ws.currentDcument

uiDoc.document.FieldB = the new values

End Sub

Ofcourse needs some finetuning to your own forms. Also needs to write back the selected value.

Subject: RE: Client

So is there something in this code that will actually SELECT the county values? A @DBlookup is returning the correct list for me…but I want it to appear that all the choices that show up on the dialog list are checkmarked (or x’d if a checkbox)…