Multivalue fields in sync

I all, this is my question:

In a document, I have several multivalue fields to keep in sync: a list of names, a list of corresponding address, a list of corresponding uid, a list of url (hopefully a link). Thus, something that can be shown in this way:

George first avenue, NY GRG www.georgesite.com/doc1

David second ave., NY DAV www.davidsite.com/doc2

Charlie first avenue, NY CHA www.charliesite.com/doc3

basically, each row is like a database recordset…

of course, the are several problem: a name can be removed or added, there is no max number of names, not all the “records” have a URL… I approached such problem with 4 multivalue text field and keep in sync with a LotusScript able to manage the arrays, but the problem is to manage the url in order to have a clickable link…

Can you suggest a best practice for this kind of problem?

TIA

G.

Subject: Multivalue fields in sync

So the problem is that the URLs appear in a computed field as element of that array field but do not appear there as URLs, just as text strings so are not activatable, you cannot click on a given member of the array/URL and have it respond with that website?

Subject: RE: Multivalue fields in sync

a general question is how to manage two or more multivalue fields that are related (i.e. the first value of field A is related to the first value of field B, thus, for instance, they must removed togheter).

a more specific question is: I must have several weblink, each of them must be clickable (working in domino client) but I don’t know how many links I can have… (say each value from 1 to 20)…

Subject: RE: Multivalue fields in sync

These are actually two separate questions.

Maintaining the data in a table depends on what client you’re doing your editing in. In Notes client there are some published techniques including Betsy Thiede’s Dynamic Tables Article in The View and Domino Design Library Examples which contains a set of design elements you can install to support this (and an example on one of the forms). In both cases, some customization of the solution is needed to support your particular set of fields.

If your client is a web browser, you might look at using the DOJO grid control to edit the data, then have JavaScript code to pack and unpack it into fields during load and submit of a form.

To make it display as a set of links, I already answered this question in a separate post to you.

Subject: RE: Multivalue fields in sync

Thanks for your links… the Dynamic Tables Article seems very interesting: I’m oriented in RichtText Table management, and the example database is really useful…

I’ll take a look of the other examples too.

Thanks.

G.

Subject: RE: Multivalue fields in sync

I haven’t looked at Ardre’s example, and my suggestion may be covered there, but one simple option is below:

– One hidden multivalue field;

– One table with two rows, one column for each record field (so one col for name, one col for address, etc). 2 fields per column, one in each row.

– First col field is computed multivalue new line separator. Second (lower) field is editable text for that value (where user inputs/changes).

– Two LS hotspots.

Use enters values in each editable field, validation requires all fields to be populated. User clicks on LS hotspot which:

  1. adds contents of each editable field as new element of computed field above it. Computed field is for user info/viewing only.

  2. concatenates contents of each editable field with unique separator (i.e. tilda) so entire record is now one string. Adds string as new element of computed hidden field.

All info for given person is listed in computed field for user to see, retaining sequence and order. Hidden field has all info from these fields as single string, single array element, and it is where the work gets done.

When user needs to edit or remove, he clicks another action that displays the hidden field in picklist (or whatever), minus the tildas. User selects record of info he wants to edit. Action then moves the selected values from each computed field into editable field for editing, also removes from hidden field.

Like I say, prob. in Andre’s examples so hope I’m not wasting your time…

Subject: Multivalue fields in sync (SOLVED)

Thanks Lisa… your approach is simple and “pure domino based” and I have several context in wich I will adopt it!

The Andre’s examples are useful if I need to work with dynamic controls (i.e. create hotspot - button or link - at runtime for each record). In this case I create a new document with a richtextitem populated by DXL (thus I can include different code for each hotspot and data from hidden multivalue field), then save as temp document, append its RTI to the one on my “true” document and destroy the temp document.

Thanks all guys, you are great!

Subject: Multivalue fields in sync

I’m working with a DB right now with 5 fields (FieldName, StartValue, EndValue, ChangedBy, ChangedDate) I had a similar issue when the StartValue or EndValue could be blank fort a series of fields.

Even though I did NOT have a trim in the multiple value field if I had several fields set to “” it would not store ALL the nulls, it just stored one.

“FName”:“Stephen”:“Steve”:“CN=Stephen M Christian/OU=/O=”:[2008-01-01 12:00 PM EST]

“LName”:“Christian”:“”:“CN=Stephen M Christian/OU=/O=”:[2008-01-01 12:00 PM EST]

“Phone”:“1234:”":“CN=Stephen M Christian/OU=/O=”:[2008-01-01 12:00 PM EST]

The value in EndValue[3] would NOT be present.

To get around this I checked to see if the value was “” and if so, I stored the magic value “{Blank}” (could be anything I just used this). Then whenever I display the field on the form I have:

@Replace(EndValue;“{BLANK}”;“”)

So in your case you could store a place holder for your URL is one is not set. Maybe just “http://”

I’m sure there maybe a better way and love to see what others suggest, but this works for me:

Subject: Multivalue fields in sync

Notes is not good at this kind of thing and you should avoid it if at all possible. Otherwise, remember that a multivalue field will compress values by removing blanks! Therefore, if any field is missing a value you must enter a placeholder (eg. ~) to ensure that the indexes remain synchronised.

For repeating data of this nature, I tend to store it as XML and use XSL to unpack the values to dynamic fields in the browser. Its much easier to manipulate such data via Javascript than with the LotusScript XML classes though.

Subject: RE: Multivalue fields in sync

Generally I agree with you Andrew, I try to use byte array too with custom data field, but in this case, the data are not available for a view… the XML solution could be ok, but only on a browser…