Solved

Dialog Box to enter new students to one field.

Posted on 2006-06-21
4
252 Views
Last Modified: 2013-12-18
Have a form where I need to enter the attendance for a class and some user info. I want to do this using a Dialog Box that pops up from say an Add Student button. I will have something like a field for Name, Title and ID. How do I go about setting this up so a trainer can click on the button and a new student will be appended to a common single multi value field. THe way I have it not I have to create a huge table of fields, once row for each student, trying to estimate the greatest number in a class. I know this is not the best way and have seend it done with a clean dialog box, but not sure how exactly it is done.

Any advice is appreciated.

Joe
0
Comment
Question by:jforget1
4 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 16955423
I would create a docment for each stdent, and then have a view that can be used as a lookup.
This is simple, and will alow for added functionality in the future.
You can have a Class  ID and other identifiers so that it will be easy to do a lookup.

I hope this helps !
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 250 total points
ID: 16955627
You can do it in a DialogBox. I have a set of functions and classes that do exactly what you want, even more, because most likely you need both Add and Remove. There is a similar set in the Sandbox somewhere (less advanced of course ;). See
    http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/f2acda4419a5e3cd00256c0e00314e05?OpenDocument
0
 
LVL 18

Assisted Solution

by:marilyng
marilyng earned 250 total points
ID: 16956811
As sjef says, you can do it, but it's a matter of keeping a before and after field.

You have a set of fields that display the nice student information, computed for display, new line for each entry.

Name ->@Word(MyList;"|";1)          Class  ->@Word(MyList;"|";2)      ID->@Word(MyList;"|";3)
Bob                                               Class1                                         BBB
Mary                                             Class2                                         CCC

You have the field (myList) that holds the list:  "Name|Class|ID"
Bob|Class1|BBB
Mary|Class2|CCCC

Then you have three buttons:  Add a student, update a student, remove a student.
And finally you have the magic, let's number the student array so we can figure out which  (although you can cycle through to find the correct record, now in 6.5)  


To add a student, you simply parse the three fields and add it to the list;
To remove one, you select an entry from the list and then remove it
Edit, you select an entry from the list, and remove the entry from the list, but put the entry values back in the fields.

Add Button
---------------------------------------------------------
List:=@Implode(Name:Class:ID;"|");
NewList:=@If(MyList="";List;MyList:List);
@SetField("MyList";NewList);
@SetField("Name";"");
@SetField("Class";"");
@SetField("ID";"");
@Command([ViewRefreshFields])

Remove Button
-----------------------------------------------------------
Nums:="0":"1":"2":"3":"4":"5":"6":"7":"8":"9";
TheseElements:=@Elements(MyList);
ThisList:=MyList;
NumList:=@Subset(@Subset(@Text(@TextToNumber(Nums*+Nums*+Nums));-999);theseElements);
List:=NumList + (". " + @Word(thisList;"|";1));
Selected:=@Prompt([OkCancelList];"Select an Entry";"Select an entry to Remove";"";List);
@If(Selected = "";@Return("");"");
k:=@TextToNumber(@LeftBack(Selected;"."));
Entry:=MyList[k];
NewList:=@If(Entry !="";@Replace(MyList;Entry;"");MyList);
@SetField("MyList";NewList);
@SetField("Name";"");
@SetField("Class";"");
@SetField("ID";"");
@Command([ViewRefreshFields])


Edit Button
-----------------------------------------------------------
Nums:="0":"1":"2":"3":"4":"5":"6":"7":"8":"9";
@If(@Elements(MyList)<1;@Return(@Prompt([Ok];"No List";"There is nothing to edit yet!"));"");
TheseElements:=@Elements(MyList);
ThisList:=MyList;
NumList:=@Subset(@Subset(@Text(@TextToNumber(Nums*+Nums*+Nums));-999);theseElements);
List:=NumList + (". " + @Word(thisList;"|";1));
Selected:=@Prompt([OkCancelList];"Select an Entry";"Select an entry to Remove";"";List);
@If(Selected = "";@Return("");"");
k:=@TextToNumber(@LeftBack(Selected;"."));
Entry:=MyList[k];
NewList:=@If(Entry !="";@Replace(MyList;Entry;"");MyList);
@SetField("MyList";NewList);
@SetField("Name";@Word(Entry;"|";1));
@SetField("Class";@Word(Entry;"|";2));
@SetField("ID";@Word(Entry;"|";3));
@Command([ViewRefreshFields])

------------------------------------------------------

Now, I didn't go through and test for BLANK values, so you might have to do that, but you get the idea.

0
 

Author Comment

by:jforget1
ID: 16960186
Thanks to all I am sure between all this information I will be able to get a good solution together.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Lotus Notes 8.0 Forward emails for 30 days. 8 104
IBM Notes 9 crashed when open any attachment file 16 486
Add a cc field to email code 6 99
Lotus Domino Server 9 4 88
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.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 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