Multiple line items in lotus form 8.5 in web application

How can I develop a form using lotus notes to input master details for my purchase request application. The user has to input multiple line items for each purchase request.
Who is Participating?

Improve company productivity with a Business Account.Sign Up

ironcladsConnect With a Mentor Commented:
Sorry for the delay.  I was really busy the past couple of months.  Here's some code taken from what I have.  Start off with the WebQueryOpen agent.  It creates HTML fields on the form.  When you click the OK button on the form, you'll then need to either copy the selected values over to an actual field on the form or, as I do it, populate a field from the parent window.  Please let me know if you have further questions and, please, don't let others make you feel back for asking for code.  As my old saying goes, "Nothing is obvious to the uninformed."  I ask for code all the time.  How else can you learn without reinventing the wheel, no?

Oh, the file is an nsf, but it has been changed to .txt.  Unzip the .txt file and change it back to .nsf.


Two possible solutions:
1. use embedded view on your form and create a document for each detail record
2. use multivalue fields

I always suggest first, cuz it's cleaner and easier to develop and maintain.
Sjef BosmanGroupware ConsultantCommented:
Web application eh? It should be relatively easy in XPages. Lacking that possibility, you'd have to develop quite some JavaScript to do it all client-side, whether you use AJAX or not.

As for multiple documents or multi-value fields: I tend to see a purchase request as one single document, and the mere thought of having request lines in separate documents makes me shiver. I therefore always suggest multi-value fields...
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

jobby1Author Commented:
sjef_bosman: i argee to your point. To mak it multiple field not possible since I dont know hw many line items in a request. It can be x number of items in a request. Any xpage samples avaialble.
Sjef BosmanGroupware ConsultantCommented:
Nothing available right now, sorry. Multiple field is definitely possible, I'll explain. If you have 4 purchase order lines, with for each POL the elements Number, Product and Price, you create 3 fields Number, Product and Price, and each field will have 4 values. So Number[1], Product[1] and Price[1] form one "record".

I suppose you can handle it using a data table control and a repeat control, but I never tried myself (yet).
jobby1, you can do what you'd like with a form when using the web.  Its pretty flexible.  If I understand your request correctly, you are looking at creating a document that has mulitple "line items", but not neccessarily have a field for each value, correct?  Of course, everything needs something mapped to something else, so you don't want values generated that are worthless to you, but you can create fields on the fly in html or just html.  When those values are populated, you can then have a single or several fields gather the values from those html fields when saving the document.  From there you can parse up the values in the stored field.  This is one way.

Another way I've used and to story line an example:  If you want to have users given a list of values to choose from that are pulled from a view.  You'd put a RichText field on the form that is set to computed, with itself as the value and display as HTML set.  From there set a "WebQueryOpen" agent on the form.  Have the Lousscript agent look up the view and for each value, compose a html span.  Inside each span put your values/tables/etc.  Populate the RichText field with the composed html.  In the JS Header of the form, when a span is clicked, populate a field with the key or value of the item clicked.  Then when they save the form, clear the rich text field so no html is saved, but the key values are saved.  I can give you some starter code if you are interested in this scenario.  With some work, you can make it do exactly what you want.

Let me know.


If this is not what you are looking for, please clarify what exactly you are trying to  accomplish and I'm sure I can help.
jobby1Author Commented:

Please give me the starter code you have mentioned.
Sjef BosmanGroupware ConsultantCommented:
I get the idea there is a misunderstanding here somewhere. A sentence like "give me the starter code" usually isn't appreciated by the Experts, in any case not by me, because it seems to indicate that you don't intend to develop the solution yourself, but you try to take advantage of someone else's work. We (in this Zone) help the developer, we don't actually develop, and when code is shared it's usually the result of shared interests or after an in-depth discussion of the problem.

As far as I can see, you never reacted on my last suggestion, which makes me assume that you don't understand the concept of putting x values in one multi-value field, where the number of elements in that field corresponds with the number of invoice lines (for instance). Don't blame us when we don't respond to your questions. It's your job to interact with us, to ask the right question and to ask questions the right way.

By the way, we Experts are volunteers, we don't get paid for answering questions at all. We just like to help people in solving their problems.

So, in response to your statement "No proper answer", I'd like to say "No proper question".

If the problem is still there, we could go on of course, if you tell us what you already tried (and more).
If you solved the problem, I'd like to know how.
Sjef BosmanGroupware ConsultantCommented:
"C'est le ton qui fait la musique" , but maybe I didn't listen right...

@Tim: you're too good :-)
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.