Xpages Extension library name picker "peopleByLastName" list processing - xpages

I found that the usage of the extension library name picker is somehow difficult when it comes to one certain case: I'd like to display people alphabetically by lastname in the selection and need their fullnames in return.
So, for returning the fullnames, the dominoNABNamePicker is the logical choice, and it seems that
<xe:dominoNABNamePicker nameList="peopleByLastName">/xe:dominoNABNamePicker>
does exactly what I need - but the resulting list is sorted by lastname only; inside of a certain lastname "block", people are shown sorted by creation date, oldest entries on top.
The base view used for displaying the entries is the ($VIMPeopleByLastName) view in the names.nsf.
This leads me to my questions:
- can I sort the 'resulting' list somehow additionally by firstname and middleinitial before displaying it to the user, showing the nicely sorted result to select from?
- is there another data provider / parameter set which returns me the fullnames displaying a "Lastname, Firstname" selection of people? (e.g.
dominoViewNamePicker data provider only returns the labelColumn, which is the same shown to select from)
- can I simply add 'ascending order' sort option to the firstname and middleinital columns of the ($VIMPeopleByLastName) view, or will this have any negative effects somewhere else?(I know this will be a pain in future releases, but seems to be the easiest way so far... )
Any further ideas also appreciated...

Related

How to get view data to copy to field in document?

I'm currently tasked to redesign an application form where several fields will need to auto-fill based on the data from a specific field when it is entered.
Since I'm relatively new to LotusNotes, my boss hinted at me to first create a view which displays the fields to auto-fill. Which I did:
| Visitor Name | Company Name | Contact No | Date Entered |
Visitor Name is the field which will determine the data for Company Name and Contact No when it auto-fills in the form. Date Entered will see which data is the most recent and will use that. Also the field must be set as Editable to allow user to change the data if need be.
However, when trying to modify the form, I can't quite get how to link the view together with my desired field in the form.
I tried #DbLookup and created the formula
#If(VisitorName = "";"";VisitorName != ""; #DbLookup("" : "" ; "Local":"D:\LotusNotes Project\HR002a.nsf"; "Visitor View";#text(ContactName);#Text(CompanyName));"")
But it doesn't seem to work when I place it in Default Value or Input Translation. Even changing the filed to Computed doesn't seem to help as well.
What else am I missing in my formula?
You could simplyfiy your formula
#If(VisitorName != ""; #DbLookup("";#dbname;"Visitor View";#text(ContactName);2;[FailSilent]);"")
I am assuming this is a form used in the Notes clieny, not on the web. If this is a web form, you need a different approach.
You could very well use #DBLookup for that task. To improve performance, concatenate all the values into one column, perform the #DbLookup on the form, retrieving the concatenated values, then split them into separate values and populate the different fields.
You could also use Lotusscript. You want to look at the NotesView class and the NotesViewEntry class (assuming you want to build it for performance). Use the ColumnValues property of the NotesViewEntry class to read the columns in the view. Remember that the first column needs to be sorted.
Or your company could hire someone that already know Notes and Domino, and have that done in an hour. That would probably be financially a better choice than you spending hours or days on this fairly simple task. There are many of us here (me included) who could jump in and fix this for your company.

OR query in eWAM - picker

So in a picker in eWam / wynsure the field usually gets passed directly to some sort of OQL statement.
Hence, if I want to search for a field whose value ends in "asdf", I enter "%asdf" into the picker field.
My question is thus: from the picker, is there anyway to specify 'I want all entries that end in "asdf" OR "qwer"'?
If not, I would recommend that this become a feature as it would be very useful to be able to enter all that right in the text field.
There is currently no way to search multiple strings in a single field beyond using wildcards. One can do this easily by creating multiple fields in the picker.
Alternatively one could customize the picker as follows:
use a presearch string (that the user fills out),
parse that string for some element (like a pipe),
Break the string up and put each part in to off screen search variables.
You are still using multiple fields, but the user get's a different experience. Keep in mind the dangers of parsing out the user input, using something like or would work out very badly splitting up words, & could show up in a company name...

How to create a view using a count of certain field

I am trying to create a categorized view of all Notes documents that have a field with exact same value, i.e. there is a field for Contractor Name and I want to create a view that lists each Contractor and the documents that relevant to each. How do I do this? I have tried view formulas like the following but no success as yet
SELECT #IsAvailable(Contractorid) & #Count(Contractorid) > 1
SELECT #Count(#IsAvailable(Contractorid)) >1
Nsf databases are no relational databases. The count of different documents with a unique value in a specific field cannot be used to build a view selection formula.
You could write an agent, that runs through all documents and counts them and puts all with count > 1 in a folder, but this is quite a lot of LotusScript code and needs some advanced knowledge.
The other possibilit would be to categorize the view by ContractorId and add one column before that categorized column: simply use 1 as column formula and select "display totals" in the column properties as well as "hide details".
Then at least you have the information, how much documents are in each category, but unfortunately you cannot filter by it and you cannot sort by this column.
A third possibility would be to use an xpage interface, but that is even more work to do and a completely different story developmentwise.
This is similar to view to identify duplicates. My approach is to use folder.
Make a new folder with design of your view. Instead of (not working) selection formula use short LS code as an action, or QueryOpen event (make sure only one user runs the script).
The code should cooperate with another (hidden) view sorted by Contractorid. Make a ViewNavigator for that view and traverse through it with simple logic - if previous entry has the same Contractorid as the current one, put both documents into folder**. That way you will get list of all documents with duplicate Contractorid. Make sure to wipe all the current content from the folder at the start.
** This can be optimized further by slightly more complicated algorithm to handle first duplicate diferently - for more than two duplicates this algorithm makes extra calls of PutInFolder method.

Add a field to the merge function view

How do I add fields to the view when merging records?
All fields on the last used form are used for merge function, you don't have to do anything specifically other than making sure they are on the form.
The fields are always filtered and only shown if one or other of the merged records contains a value - this avoids wasting time and screen real estate asking users to select between two blanks, so they more easily see the fields that are different. Bit fields (two options) are included since they always have a value of 0 or 1.
See this page for some practical tips as well:
http://blogs.msdn.com/b/emeadcrmsupport/archive/2013/12/18/dynamics-crm-2011-merging-records-issue-with-multiple-forms.aspx

Sharepoint: Person column in custom list

I have a Person field in my custom list. I want to have a view that will show multiple fields from that Person instead of the one I had to choose when creating the Person column.
So basically I want to have one column for Person and then in the view see Name, title, email, phone. All of those are valid choices but I can only pick one right now.
I really want to avoid typing in the username lookup for each column I choose to display.
This is SP 2007
It sounds like you need to create a custom fieldtype (with a fieldcontrol) that inherits from the userfield but in viewmode renders out the different columns you need. Is that something along the lines you are looking for?
http://www.sharepointblogs.com/nicksevens/archive/2007/08/31/create-custom-field-types-for-sharepoint.aspx
Note: This link is broken
You probably want a Computed Field. Note that this is not a Calculated Column. A Computed Field is what is used to display the same data is different ways. In SharePoint there is a Title field, but there is also a "Title (linked to item with edit menu)" computed field as well as a "Title (linked to item)" computed field.
See midway down this link for more details. I'm not sure if it will have all of the power that you need, but if it does it is almost certainly what you are looking for if you don't mind getting into the Schema XML file a little.
Could you use a DataView web part for this? If it's just a question of viewing the data that might be suitable.
Came across this thread and thought I'd add a tip. This suggestion is clearly not for every use case, but may work well in situations where you're managing a list rather than allowing manual inputs (verified to work with SP 2013):
Create a spreadsheet with columns to match your SharePoint list that contains multiple profile fields. (for example: name, phone number, email address)
In the spreadsheet, enter the same email address in all of the person/group field types in that row. (e.g., boss#company.com, boss#company.com, boss#company.com)
Select and copy the row(s) you wish to transfer to SharePoint.
In SharePoint, change the list view to "Quick Edit" and paste the row(s) into the grid.
SharePoint will process each field and convert the email address to the profile value you selected during the list setup.

Resources