• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 468
  • Last Modified:

List Aliases

Most learned experts,

I have a quandry about aliases. I have a field that contains a selection with their aliases.

Full name1 | alias1
Full name2 | alias2
etc.

I need to get back to the full name of the selection and not the alias as I need to do a check on the full name within the form. I looked at a question that was answered by CRAK but am still very confused.

BTW - I am on R5.0.12. Thank you.

0
notesrookie
Asked:
notesrookie
  • 9
  • 7
  • 6
  • +2
3 Solutions
 
marilyngCommented:
The field allows you to "view" full name1, but stores alias1  in the field.

If you were to view the forms in a view column, you would see alias1 and then have to transpose them back to the fullname,

i.e. @if(fieldname="alias1";"Full Name1"l fieldname="alias2"; "Full Name2"..and so on.

Your "recovery" might be the same in an agent, if you wanted to create another field, "showalias"

I tend to put both values in a computed field at the top of the form(theList)
"Full Name1|alias1":"Full Name2|alias2":"and so on"

This way I can always cycle through them to show either the alias or the string value.

Does this help?
0
 
ZvonkoSystems architectCommented:
Is this question for Browser or Notes client?
0
 
CRAKCommented:
I'm not sure which question/answer you are refering to, but I'll give you an example of what I'm currently using:

A multi value computed for display field, collects a set of choises from a view. These choises can be defined by content managers in the database.
Assume the field is called "checkbox_choises". Its formula could be a @DbLookup or a @DbColumn:
@DbColumn("":"NoCache"; @DbName; "<viewname>"; 1)
This may raise a list like "Choise 1|Ch1":"Choise 2|Ch2":"Choise 3|Ch3"
You may also feed it with that exact list for evaluation of this example.

A 2nd field is (in my case) a checkbox field (editable), called "checkbox".
Its choises are retrieved directly from checkbox_choises. You'll notice it'll return the aliasses as expected.

A 3rd field should collect all of checkbox_choises values, that were selected in checkbox.
I called the (multi value, computed) field "checkbox_selected".
It's formula is:

input_lst := checkbox_choises;
select_lst := checkbox;
input_scrambled_selection := @ReplaceSubstring(input_lst; select_lst; "");
input_delete_unscrambled := @Replace(input_lst; input_scrambled_selection; "");
@Trim(input_delete_unscrambled)

If you selected Choise 1 and Choise 3, checkbox will hold "Ch1":"Ch3".
Checkbox_selected will now hold "Choise 1|Ch1":"Choise 3|Ch3".

Instead of using an @If statement to (again?!) hard-code a list of choises, you can now use the value of checkbox_selected to get hold of the chosen values. Works inside the document and in views!
Try for example:
@Left(checkbox_selected; "|")

0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
Sjef BosmanGroupware ConsultantCommented:
Are both "full name" and "alias" stored in documents anywhere? So you can retrieve them and create code to compute the full name from an alias?
0
 
notesrookieAuthor Commented:
I am working in a Notes client and within a form. The field is an editable dialog list allowing only a single selection. The selections are included in the field under Enter Choices (one per line). The alias information is used in a bunch of views and I would like not to disturb the scheme of things. The full names and the aliases are only stored in this field. Is there still a way to get the full name instead of the alias within the document

I used CRAK's method, copying his choices into my dialog list field but the last field mentioned still only showed the alias.

Sorry!
0
 
Sjef BosmanGroupware ConsultantCommented:
notesrookie,
> Is there still a way to get the full name instead of the alias within the document
No.
0
 
marilyngCommented:
CRAK's should work, and sjef spoke too soon :)

TheList:
"Full Name 1|alias1":"Full Name 2|alias 2":"Full Name 3|alias 3"  in a computed, multi-value field at the top of the form.

Then your combo box(etc) formula can reference the field, theList.  Which doesn't change the values in the dialog box or the selected or the views.
Then you add a few more fields to eventually end up with the ALIAS value(s) matching what is selected in the combo/list box.

Also,  check out this http://www.experts-exchange.com/Applications/Email/Lotus_Notes_Domino/Q_21784267.html, where sjef and I provide several ways to concatenate and cycle through the multi-value, concatenated field.

These are very similar to CRAK's suggestion - if you know one value, then getting to the other is possible as long as they're linked somewhere in a field.

Goes without saying that if you test on a separate database, you will also have to update the existing data forms to reflect the changes.
0
 
Sjef BosmanGroupware ConsultantCommented:
I meant to say: No, not dynamically. When hard-coded, everything is possible...
0
 
CRAKCommented:
Did you change the fieldnames where the vars "input_lst" and "select_lst" retrieve their values from? I assume you're still using your own dialox list / checkbox / radio button /...

When testing (with the 3rd field visible), you might want to set "refresh fields on keyword change" (in the checkbox field). This shouldn't affect your results though.
0
 
notesrookieAuthor Commented:
CRAK - yes I did change the fieldnames. Field #1 contains the fullnames and aliases, is called customer and contains "Choise 1|Ch1": "Choise 2|Ch2": "Choise 3|Ch3". In field#2, chk_customer, it is computed and I have the formula customer. In field #3, customer_selected, computed contains the formula you mentioned.

Formula for field #3:
input_lst := Customer;
select_lst := chk_Customer;
input_scrambled_selection := @ReplaceSubstring(input_lst; select_lst; "");
input_delete_unscrambled := @Replace(input_lst; input_scrambled_selection; "");
@Trim(input_delete_unscrambled)

When I select Choise 1 in field #1, field #2 and 3 both show Ch 1. I must have gotten something mixed up? Thanks.
0
 
Sjef BosmanGroupware ConsultantCommented:
You need:
- one computed field called AllCustomers, multi-value, with
    "Choise 1|Ch1": "Choise 2|Ch2": "Choise 3|Ch3"
- one dialog list field called Customer, with a formula for its choices
    AllCustomers
- one computed field CustomerName with the formula
    @Replace(Customer; @Right(AllCustomers; "|"); @Left(AllCustomers; "|"))    
0
 
marilyngCommented:
sjef.. so, gotcha twice today, huh?   Glad it's becoming possible...
0
 
Sjef BosmanGroupware ConsultantCommented:
I can't stand hard-coded "flexibility"... My "No" still stands, I think.

It would have been better to have the AllCustomers field with a formula like
    @GetProfileField("Settings", "AllCustomers")
or
    @DbColumn("";"";"CustomersView";1)
or something programmatic.
0
 
notesrookieAuthor Commented:
I agree with you, sjef, about the hardcoding. Unfortunately it's an inherited database and where I used to have a mental block about LS, now I find that I have a mental block about profile documents. Not sure why, I think I'm afraid of them and I haven't had the time to read up on them. Got any good sites I can go to to read up on that or should I open a new question about that?

Let me try what you suggested. Thanks.
0
 
notesrookieAuthor Commented:
Cool, sjef - Thanks for explaining things to me. I was looking at what CRAk and marilyng were saying but it did not get through to my processing thought center. So I'll split the points with you getting the majority of it. Once again the fog has been lifted. Arigato, kamsahabnida, gracias, merci and dank u.
0
 
Sjef BosmanGroupware ConsultantCommented:
Graag gedaan! ;)
0
 
CRAKCommented:
"dank u"?!
Hmmm.... sounds familiar! Notesrookie, where are you from?

And did you get my example to work, or do you want me to upload a working example to an FTP server somewhere?
0
 
marilyngCommented:
Well, tuttie-frutti -  Crak, you and I do all the hard work and sjef kicks in after he again says , "it can't be done.." to prove us wrong, and gets the points... hrumph! :0)

Just kidding, really..

To answer your question, notesrookie, about profile documents.  They are marvelous if:  they are for user configuration and have user names attached to them, or they are for database configuration and, by that virtue, don't change much..

I always add default values to all my profile documents because, guess what?  The second you call it, it's there, so a if /is nothing check always fails because a profile doc is always something.  I understand some people have had problems with them (database profiles) in replicated databases, but I have not, ever.

Some people try to use them as sequential numbering documents... that's a no-no.. because the profile document caches for the user, and doesn't update until the user exits and reopens notes.
0
 
Sjef BosmanGroupware ConsultantCommented:
Profile documents are brilliant solution to "static" memory: configuration settings, session variables, things that need to be saved temporarily without putting them into environment variables cluttering up Notes.ini. On the other hand, profile documents can be a real pain in the butt. When you update a profile document on two different servers, there will be two different profile documents that are NOT replicated: each server is stuck with the same profile document.

I made some functions to deal with this problem, one is to read the profile document in memory, then to delete all existing profile documents, and then create a fresh one from the data stored in memory. Very strange. I later explicitly added the field $ConflictAction with a value of "3", to try to merge profile documents whenever possible. This was necessary because I don't create profile documents using a form.
0
 
CRAKCommented:
Marilyn, you're right: it's not fair that {My "No" still stands}-sjef runs off with "our" points! Perhaps I should consult our PE....?!  LOL!
Nah.... I find confort in knowing that we tought TWO people something in a single question! ;-)) How 'bout you?
(just pulling sjef's leg, notesrookie!)
0
 
Sjef BosmanGroupware ConsultantCommented:
It's not fair, getting both my legs pulled at the same time! :'( Such fine legs...

I think you two just can't handle it. What a disgrace. But, I'll make a gesture out of my good will and generosity: there's a certain Page Editor (we won't mention his name of course) whom I'll ask to adapt the points as he sees fit, but only if Notesrookie agrees. May I quote Daffy on this? Better not: see http://www.despicable.org/

*smirk*
0
 
marilyngCommented:
LOL
0
 
CRAKCommented:
Oh please give the PE a break.... he has just finished editing a question (marilyn, you're welcome) and hopes this should not become a habit. Besides, he remembers a few occasions where one of the experts (often the same for some reason) saw no need to reassign points.
Personally, I feel the same here!
Let's not give notesrookie the wrong impression: nothing wrong with what he dis. And his explanation said it all: Marilyn and I didn't get through to his CPU untill you rephrased it.

Marilyn, the next time we each pull one of sjef's legs, let's tie him down before he crawls up again! ;-))
0
 
marilyngCommented:
Agreed... I really wasn't looking for points either in this or the other question. I was amused at the irony of it all: the one who got the points was the one who said it couldn't be done and who went about trying to prove that it couldn't be done only to discover that it could.

The other question had the "it's not possible" response marked as the answer.. which, if you read through the question, saw that there was an answer, along with some nice discoveries.  I just wanted to make sure that people referencing the question didn't dismiss the rest of the solution because of the "accepted answer".
0
 
notesrookieAuthor Commented:
sjef, CRAK, marilyng,

Thanks for all your help. I had to award sjef the point because he actually spelled it out for me that it couldn't be done and then he turned it around. A much more difficult feat, don't you think?

But I'm originally from Malaysia and speak several languages, unfortunately Dutch is not one of them. "Dank u: is the only word I know. I now reside in sunny California (except it's been raining lately, a lot!)

I'm sure I will be posting more question in the future and I'm sure that you, CRAK and you, marilyng, will be getting the points instead of sjef. :D

Take care and may the domino be with you (i know ... *groan*)
-Notes Rookie
0
 
marilyngCommented:
We all appreciate when someone restates what others have said in a way that makes a bit more sense.   The important thing is that you got the help you needed.
0
 
CRAKCommented:
I second that!
0
 
Sjef BosmanGroupware ConsultantCommented:
I third!
0
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.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 9
  • 7
  • 6
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now