Link to home
Start Free TrialLog in
Avatar of pratigan
pratiganFlag for United States of America

asked on

Field convert for server document link

What is the best way to take the value from a form field and convert it, behind the scenes, to a specific xref value in order to access a document on the server with that xref value.  Ex:  process B-P-030 entered has a xref of 79, the document name on the server is 79.doc.
Thank You !
Avatar of zvonko
zvonko

It depends :-)

It depends on two things: how many rows and how offten are this rows changed.

If less then 100 rows and seldom changed, then it is bad habit (but good working :-) to put the list complet into DialogList design.
Do it like this:
Create a new field, type: DialogList
In second tab of field property box enter for choices this lines:
B-P-030 | 79.doc
B-P-031 | 80.doc
B-P-032 | 81.doc
B-P-033 | 82.doc

That mean: user does see field Text "B-P-032" and in the document item value is stored: "81.doc"

In web both values are accessible by JavaScript, in LotusScript only the stored value "81.doc"

The correct design, on other hand, would be to make a view for this choices. Than you can enter for this field choices not the values line by line, but a single @DbLookup formula. This can be done in several ways, so please state first wath your aproach will be: hardcoded in desing or with @DbLookup

And please increase the points a bit if you have more questions about this. One hundred would be enough for this sort of questions.


So long,
zvonko

Avatar of pratigan

ASKER

Fastst and easiest approach.  The conversion values will never or very rarly change.  There are a little over 330 row.  I was thinking of accessing a list ?!?!?!
I will increase the points if the approach is harder than I thought.
Thank You !
Paul
Uuuups, 330 are managable to be placed directly into design, but not realy a good idea.

So if you say they are hardly change, then do it like this:
1.) Create a form, name: ConfigDoc
2.) Give this form two fields: ConfigKey and ConfigValue
3.) ConfigKey is simple Text, ConfigValue also Text but with option: AllowMultipleValues
4.) Create a document with this form. Enter this field values:
ConfogKey: xref
ConfigValue: B-P-030 | 79.doc; B-P-031 | 80.doc; B-P-032 | 81.doc; B-P-033 | 82.doc
5.) Create a view, name: ConfigDocs
6.) ViewSelectionFormula is: SELECT ((Form = "ConfigDoc"))
7.) First and only colum of this view is SORTED and use the field: ConfigKey
8.) On your form create a field of type DialogList
9.) For the choices in second property tab enter this formula:
@DbLookup("";@DbName;"ConfigDocs";"xref";"ConfigValue")

Next time when you create a document with your form containing this DialogList field, and you click on EntryHelper twistie, then you get a list of LeftPart values, like:
B-P-030
B-P-031
B-P-032
B-P-033

But when you store this document then you will see the  coresponding value stored into your document (79.doc...)

My upper statement with accessing leftpart text is not absolutely true. As long as you are in the form on Notes client you can access this field text by the NotesUIDocument function uidoc.FieldGetText
In stored document or in client backend document you get only the right part value ( 79.doc ... )

Is this something you can use?


HEllo Zvonko,
This is exactly what I can use.  I was in the process of creating a form as I received your reply.  I was going to create a form with 2 fields and then hide the form, then create a single view to extract the specific value xref from depending upon the value I enter in the processid field.  Whihc is what you have indicated. However, I was not thinking of the dialog drop down formula, thats a great added feature to this process.  Thank You !!
How many points do you feel worthy of.
Thanks !
Paul
ASKER CERTIFIED SOLUTION
Avatar of zvonko
zvonko

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank You Zvonko... I have updated the points to 50.
Thanks Again for all your Help !!
Paul
Thank You !!
you are welcome :-)

hope next time to be also of help to you.

So long,
zvonko


Hello Zvonko,
I'm getting a message when I create a doc with that dialoglist field, entry not found in index or index not built.... Any ideas ?!?!?!
Thanks !!
I got a mess with all the mails :-)

have we settled all now?

Yes.. I have resolved the index problem.  
Thank You much !!!
Paul
FYI.. Zvonko,
The hidden document with xref andthe convert values is appearing within my list of views, but no data fields are showing, but the document created to perform the conversion is creating a place holder in the views.  Is ther a way to prevent this placeholder and have the conversion document just exist in the background.  The views do not contain any of the fields from the conversion document.????
Hello Zvonko,
Please disregard previous note... it came to me after I sent it.
Thanks !
Paul