Link to home
Start Free TrialLog in
Avatar of notesrookie
notesrookieFlag for United States of America

asked on

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.

SOLUTION
Avatar of marilyng
marilyng

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
Avatar of Zvonko
Is this question for Browser or Notes client?
SOLUTION
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
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?
Avatar of notesrookie

ASKER

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!
notesrookie,
> Is there still a way to get the full name instead of the alias within the document
No.
Avatar of marilyng
marilyng

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 https://www.experts-exchange.com/questions/21784267/Creating-a-Column-View.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.
I meant to say: No, not dynamically. When hard-coded, everything is possible...
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.
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.
ASKER CERTIFIED SOLUTION
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
sjef.. so, gotcha twice today, huh?   Glad it's becoming possible...
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.
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.
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.
Graag gedaan! ;)
"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?
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.
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.
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!)
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*
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! ;-))
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".
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
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.
I second that!
I third!