Solved

Create Custom Data Entry Form/Dialog

Posted on 2006-06-21
19
383 Views
Last Modified: 2013-12-18
What I need to do is to allow my users to enter a value for one field for every record in a view. I need the user to be able to enter this information very quickly. I thought about doing this through an Editable column in the view but it takes too long to enter edit mode in the view. The number of entries in the view can vary and I dont know what the maximum number is going to be.

Is there a way where a user can be presented with a custom form or dialog box that would take all the values from a column in a view and give the user a data entry field next to the value from that column?

I am basically looking for an entry method similar to Excel but for Lotus Notes.... I would create a form and have them enter information into the form but I dont know how many field to put into the form as the maximum.

Any ideas??
0
Comment
Question by:TheBull369
  • 9
  • 6
  • 4
19 Comments
 
LVL 18

Expert Comment

by:marilyng
ID: 16956623
Other than killing the 64K limit?
Question..

Column: a:b:c:b:g:h:j:a:a:a:c:c:c:

So, are we talking about changing all the a's to zz, the b's to yy, the c's to xx, the g's to ww.. and so on, or change the entire column to a different value?

Your dialog box would have to have a "base" field that does an @Unique(dbcolumn) lookup of the column:

a:b:c:b:g:h:j:a:a:a:c:c:c:  < real column.

a:b:c:b:g:h:j  <Unique value

view sorted by your a:b:c: column

Dialog box with two fields and a button;  First field select a value to be changed, second field, enter the change value.

Button:  GO

Dim session as New NotesSession
Dim db as NotesDatabase
set db = session.currentdatabase
Dim ws as New NotesUIWorkspace
Dim uidoc as NotesUIDocument
dim doc as NotesDocument
set doc = ws.currentdocument.document
Dim view as NotesView
Set view = db.getView("lookupView")

Dim Key as String
Dim ReplaceValue as String
Dim coll as NotesDocumentCollection

key = doc.getItemValue("SelectedValue")(0)
ReplaceValue = doc.getItemValue("Replacevalue")(0)

set coll = view.getalldocumentsbykey(key, True)
if coll.count>0 then
  call coll.stampall("thisField",replaceValue)
end if

call view.refresh
'the clear the document values so the user doesn't keep trying to redo the same ones..

-----------
ON the dialog box, and you can't really make it a dialog box, because you're calling it from a view.  So, you would have to be sure that there is a document selected and that the dialog box doesn't write to the selected document.  Or just call a regular form and set the saveOptions to "0" so it can never be saved. (better, BTW)
--

You can also step through each document in the view and flash the value in one field, and in the other field ask the user to input another value.   Any number of ways to approach this.

I tend to have a massive update form on my more complicated applications where users can globally change bunches of things.

YOu can even do this in formula  language, too.
0
 

Author Comment

by:TheBull369
ID: 16956927
what is the best way to go about it with a massive update form?? Is there a way to take this view and create a massive input form?? Like I said I am not sure how many rows of data there will be... Here is an example of what we have

Item   Quantity on Hand
Baseball       ____  The quantity on hand is where the user puts in a value for each item
Basketball    _____
Soccerball   ______  

The list could be 50 items long or it could be over 200 items long
0
 

Author Comment

by:TheBull369
ID: 16957074
what part of notes has 64k limit?
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16957079
My massive updates tend to do global things:

Increase all amounts by 5%, markup to 10%.
Generally, it's a table that has all the global buttons in a row with descriptions of what each does.  
Each button opens a dialog box where they can enter stuff and do the global updates.
I'm not sure stepping through the view is any faster in a dialog box than in the view itself.. especially since we now have the ability to do in view editing.

So, this particular function is called:  Update Quantities

The dialog box would count the number of items in the view when the dialog opens

Three fields:  Item
                    Current Quantity          Change Quantity
 

                               Previous and Next Buttons
                              Item #_ of Total Items counter_

The logic is something like
when the dialog box opens, count the view entries
do the doc = view.getnthEntry

Open that document in the dialog.
When then Prev or Next button is pressed
-see if the change = current, if not, change and save the document
-see if there is an entry in the button direction
-if so, move to that entry, if not "Message- end of line.."

-----
You can also trigger the changed field to update on exit and move to the next item in the view.

then you can add a markup all quantities by ___ % or each.
-------------
You can also do a tools\adjust quantities on selected, and let the user select bunches of items to change the quantities.
------

Generally, with quantities on hand and merchandise, someone is expected to step through and update each.  There is a kind of copy-machine that you add because they do a lot of repetition on item descriptions and minor entries.  Then there is a global markup on price and discounts, but the quantity on hand.. hard to globally set that.  You either have 10 items, or not. :)



0
 

Author Comment

by:TheBull369
ID: 16957098
Do you have a code sample of how the dialog function would work with the next and prev?? that might work if there was a next and prev capability to it and if it automatically saved the change when they click next...

I originally thought about doing it through in view editing but if the user doesnt click just right it wont go into edit mode. These users arent the greatest with a computer...
0
 
LVL 18

Accepted Solution

by:
marilyng earned 500 total points
ID: 16957416
Yeah, basically, you have the button on the view action bar.
YOu could have done this, you know.. fairly easy once you think about it.  

the dialog box has the saveOptions field set to "0"
it has the DocID, RecNo, ItemName, Quantity and I used Quantity_1 for the changed Quantity.

PostOpen Event:...................................................................
'Basically grabs the first document in the view.
Sub Postopen(Source As Notesuidocument)
      Dim Session As New NotesSession
      Dim db As NotesDatabase
      Set db = session.currentdatabase      
      Dim doc As NotesDocument, ludoc As Notesdocument
      Set doc = source.document
      Dim view As NotesView
      Set view = db.getView("theBull")
      Set ludoc = view.GetNthDocument(1)
      If Not ludoc Is Nothing Then
            With doc
                  .docid = ludoc.Universalid
                  .RecNo = 1
                  .ItemName = ludoc.ItemName(0)
                  .Quantity = ludoc.quantity
                  .quantity_1 = ""
                  .computewithform False, False
            End With
      End If
      source.GotoField("Quantity_1")
      
End Sub

Next Button...............................................................
Sub Click(Source As Button)
      Dim Session As New NotesSession
      Dim ws As New NotesUIWorkspace
      Dim uidoc As NotesUIDocument
      Set uidoc = ws.currentdocument
      Dim db As NotesDatabase
      Set db = session.currentdatabase
      Dim doc As NotesDocument
      Dim ludoc As NotesDocument
      Dim view As NotesView
      Set view = db.GetView("thebull")      
      Dim RecNo As Integer
      Dim Quantity As Double
      Dim Quantity_1 As String
      Set doc =  uidoc.Document
      
      'this open document
      RecNo =doc.RecNo(0)
      DocID = doc.DocID(0)      
      Quantity = doc.Quantity(0)
      Quantity_1 = doc.Quantity_1(0)
      'Now see if the original document needs to be updated
      If quantity_1<>"" Then
            If Cdbl(Quantity_1)<> Cdbl(Quantity) Then
                  Set ludoc = db.GetDocumentByUnid(DocID)
                  If Not ludoc Is Nothing Then
                        ludoc.Quantity = Cdbl(Quantity_1)
                        ludoc.save True, False, True
                  End If
            End If
      End If
      'Now increment the recNo and find the next document in the view            
      Set ludoc = Nothing
      view.Refresh
      RecNo = recNO +1
      Set ludoc = view.GetNthDocument(recNo)
      If Not ludoc Is Nothing Then
            'do nothing
            doc.docID = ludoc.UniversalID
            doc.RecNo = recNo
            doc.ItemName = ludoc.ItemName(0)
            doc.Quantity  = ludoc.Quantity(0)
            doc.Quantity_1 = ""
            uidoc.GotoField("Quantity_1")
            uidoc.refresh
      Else
            Msgbox "Sorry, there are no more records in this direction",,"End of LIne"            
            Exit Sub            
      End If
End Sub

----------------
Previous Button is similar..............................................................................
Sub Click(Source As Button)
      Dim Session As New NotesSession
      Dim ws As New NotesUIWorkspace
      Dim uidoc As NotesUIDocument
      Set uidoc = ws.currentdocument
      Dim db As NotesDatabase
      Set db = session.currentdatabase
      Dim doc As NotesDocument
      Dim ludoc As NotesDocument
      Dim view As NotesView
      Set view = db.GetView("thebull")      
      Dim RecNo As Integer
      Dim Quantity As Double
      Dim Quantity_1 As String
      Set doc =  uidoc.Document
      
      'this open document
      RecNo =doc.RecNo(0)
      DocID = doc.DocID(0)      
      Quantity = doc.Quantity(0)
      Quantity_1 = doc.Quantity_1(0)
      'Now see if the original document needs to be updated
      If quantity_1<>"" Then
            If Cdbl(Quantity_1)<> Cdbl(Quantity) Then
                  Set ludoc = db.GetDocumentByUnid(DocID)
                  If Not ludoc Is Nothing Then
                        ludoc.Quantity = Cdbl(Quantity_1)
                        ludoc.save True, False, True
                  End If
            End If
      End If
      'Now increment the recNo and find the next document in the view            
      Set ludoc = Nothing
      view.Refresh
      RecNo = recNo -1
      If RecNo <1 Then
            Msgbox "Sorry, you are already at the beginning of the view",,"At the Beginning"            
      End If
      Set ludoc = view.GetNthDocument(recNo)
      If Not ludoc Is Nothing Then
            'do nothing
            doc.docID = ludoc.UniversalID
            doc.RecNo = recNo
            doc.ItemName = ludoc.ItemName(0)
            doc.Quantity  = ludoc.Quantity(0)
            doc.Quantity_1 = ""
            uidoc.GotoField("Quantity_1")
            uidoc.refresh
      Else
            Msgbox "Sorry, there are no more records in this direction",,"End of LIne"            
            Exit Sub            
      End If
End Sub
-------------------------------------------------------------
View Action button opens a dialog box:

@DialogBox("bulldialog"; [AUTOHORZFIT] : [AUTOVERTFIT] : [NONEWFIELDS] : [NOFIELDUPDATE] : [SIZETOTABLE] ; "Quantity Update" )



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

Although I'm sure that others will have suggestions to streamline, like use view entries, or formulas for next and prev... :)  This is rough.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16957900
No streamline suggestions, just suggestion to be cautious: think carefully what happens when documents are added to or removed from the view while the user is editing them.

My approach would be (for relatively small numbers of documents):
- create a temp. NotesDocument
- get the ID and other info from those documents, and put it in multi-value fields on that temp. document
- use a DialogBox to present that temp document
- have buttons Add, Remove, Next, Previous to go through individual "record"
- if you need something fast, then add a field before and a field after the data entry field; when the users types the arrow-down key, the Entering-event of the next field can trigger the next record to be fetched

A set of functions can be found in the Sandbox:
    http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/f2acda4419a5e3cd00256c0e00314e05?OpenDocument
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16959018
Yeah, my suggestions already do ALL that.  Surprised!! you usually post when you have something NEW to add.  

BTW that R5 tablewalker is really not all that good a solution.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16959120
I must be getting old... They do all that?? Do they read all data into ONE document? Where's the Entering-event? Can't find them.

There is a different tablewalker, by Andre Guirard I think. Can't find it though. And I have one...
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 18

Expert Comment

by:marilyng
ID: 16959314
Yeah, the dialog box opens with the first document, then each next and prev just grabs the next doc in the view information into the dialog box, if it changes, then it looks up the docID and saves to the real document, else prev/next steps through the view.

Since it's a dialog box, it has to grab the first entry that is highighted or selected, the postopen just moves it to the first document in the view.

After that, it just reads data into the temp dialog box.  duh..
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16959401
Instead of stepping through the view, I read it all in. And where is Add? Or Remove? Ah no, there's still some functionality to think about in your solution.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16959460
No add or remove, just change, and no indication of how many items in the view.  Can be ten can be a thousand.  You're wrong.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16959490
Ah, we agree again... Let's quit the quarrel, and let TheBull select a solution, so we can continue from there.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16959496
Ok, if you read the entire view into a temp document - docID's, then what? Post in another "view"  

You are welcome to post your solution.  I did this last night in a few hours, tested.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16959703
I usually don't post detailed solutions, you can find the outline above :)

The temp document is used by the DialogBox, and all buttons operate on the internal multi-value fields. Very fast. It depends on the number of documents in the view whether it is a feasible solution.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16963435
Very disappointed that yours is a synopsis of my very detailed response, and that you still want to be considered for collect points.  Foul, Fowl, sir!
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16966650
TheBull, no points for me please here!
0
 

Author Comment

by:TheBull369
ID: 16968403
Thanks Marilyn... That is what I was looking for....
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16973374
You are welcome.  I enjoyed the challenge.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now