?
Solved

List Aliases

Posted on 2006-04-17
28
Medium Priority
?
457 Views
Last Modified: 2013-12-18
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
Comment
Question by:notesrookie
  • 9
  • 7
  • 6
  • +2
28 Comments
 
LVL 18

Assisted Solution

by:marilyng
marilyng earned 200 total points
ID: 16473752
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
 
LVL 63

Expert Comment

by:Zvonko
ID: 16475232
Is this question for Browser or Notes client?
0
 
LVL 13

Assisted Solution

by:CRAK
CRAK earned 200 total points
ID: 16475714
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16476090
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
 

Author Comment

by:notesrookie
ID: 16478444
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16478657
notesrookie,
> Is there still a way to get the full name instead of the alias within the document
No.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16479552
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16479690
I meant to say: No, not dynamically. When hard-coded, everything is possible...
0
 
LVL 13

Expert Comment

by:CRAK
ID: 16480456
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
 

Author Comment

by:notesrookie
ID: 16502728
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
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 1000 total points
ID: 16502897
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
 
LVL 18

Expert Comment

by:marilyng
ID: 16503834
sjef.. so, gotcha twice today, huh?   Glad it's becoming possible...
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16505325
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
 

Author Comment

by:notesrookie
ID: 16508487
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
 

Author Comment

by:notesrookie
ID: 16508877
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16509129
Graag gedaan! ;)
0
 
LVL 13

Expert Comment

by:CRAK
ID: 16509567
"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
 
LVL 18

Expert Comment

by:marilyng
ID: 16512467
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16513960
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
 
LVL 13

Expert Comment

by:CRAK
ID: 16514272
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16514387
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
 
LVL 18

Expert Comment

by:marilyng
ID: 16514695
LOL
0
 
LVL 13

Expert Comment

by:CRAK
ID: 16514893
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
 
LVL 18

Expert Comment

by:marilyng
ID: 16515036
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
 

Author Comment

by:notesrookie
ID: 16519971
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
 
LVL 18

Expert Comment

by:marilyng
ID: 16520061
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
 
LVL 13

Expert Comment

by:CRAK
ID: 16520104
I second that!
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16520142
I third!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Integration Management Part 2
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month16 days, 11 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question