Creating A dialog Box for selection

Form 1 has a field called GroupSelect with the values

Owner
Worker
All

It also has a SendTo Field.

View NagView has all my user with group assignment

Owner   Bob
Worker Stan
ETC

I want to remove the GroupSelect field and make SendTo Computed and have a button on the form that pops open a dialog form with the GroupSelect(CheckBox) and GroupUsers(CheckBox).  I would like for the default for GroupUsers to show all the names from the NagView view, but no one checked.  When they select a value in GroupSelect such as owner - check mark will appear by Bob - etc etc etc

Here is the code that works now for a prompt

choices:= @Name([CN];@DbLookup("":"NoCache";""; "(Users By Group)"; "All"; "Username"));
defaults:= @Name([CN];@DbLookup("":"NoCache";""; "(Users By Group)"; EmailAss; "Username"));
@If(@IsError(Result);"";result);
st:= @Prompt([OkCancelListMult]; "title"; "prompt"; defaults; choices);
    @If(st=""; ""; @SetField("SendTo"; st))

JaziarAsked:
Who is Participating?
 
qwaleteeCommented:
The VALUE formula for SenTo should be @Name([CN];@DbLookup("":"NoCache";""; "(Users By Group)"; GroupSelect; "Username"))
That should return the members of the selected group, so that those become the value of teh SendTo field, which means that all mathcing values get checked off.

To help debug this, please add some computed text with the following formula:

lookup := @Name([CN];@DbLookup("":"NoCache";""; "(Users By Group)"; GroupSelect; "Username"));
msg := "The value of SendTo (boxes checked off) should be:";
@Implode(msg : @Text(lookup); " ~ ");

The computed text should show the members of the group, and the values should all exactly match the text of the appropriate check boxes in SendTo.
0
 
JaziarAuthor Commented:
Here are the steps I have taken thus far

Created a form called SendToUser
There are 2 fields GroupSelect and SendTo
GroupSelect has values Owner - Worker - All

In the Postrecalc - I have

result := @Name([CN];@DbLookup("":"NoCache";""; "(Users By Group)"; "All"; "Username"));
    @SetField("SendTo"; @If(@IsError(result); ""; SendTo=""; result; SendTo))

In the SendTo formula is
@Name([CN];@DbLookup("":"NoCache";""; "(Users By Group)"; EmailAss; "Username"))

Here is my action button in Form 1

@DialogBox("SendToUser";[NoCancel];"Address");

It kinda looks like it is working but is not
0
 
qwaleteeCommented:
Have the GroupSelect radio button field set to refresh form when field value changes.


Have the choices lookup for the GroupUsers lookup all names, applying @Unique.  That way, all names are available to display at all tims.

Have its value formula just lookup the users assocaited with the group currently selected in the other field.

0
 
JaziarAuthor Commented:
Have the choices lookup for the GroupUsers lookup all names, applying @Unique.  That way, all names are available to display at all tims.

Have its value formula just lookup the users assocaited with the group currently selected in the other field.

putting these two together is my problem.

my SendTo is a checkbox - use formula for choices
@Unique(@Name([CN];@DbLookup("":"NoCache";""; "(Users By Group)"; "All"; "Username")))

when I open the form it shows all the users names and nothing is selected (Perfect) - this is right so far
now when I click owner in the GroupSelect, I would like for all the names to stay there(or refresh) with the owners now checked.  It seems like I can not show all users and make the selection.  If I only wanted to show the selected users it works fine - but I need for them to be able to see the user and select a additional person if they need to
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.