is there a list available with the possible keywords for the keyword parameter in the #DbLookup statement?
is there also an explanation available for those keywords?
Thanks
Mario
Look for the help topic for #DbLookup in the Lotus Domino Designer Help database which is part of your Notes client installation (and part of the Domino server installation). The following is taken from that documentation about the Keyword parameter:
Keyword. Optional. Keywords can be concatenated.
[FAILSILENT] returns "" (null string) instead of an error if the key cannot be found.
[PARTIALMATCH] returns a match if the key matches the beginning characters of the column value.
[RETURNDOCUMENTUNIQUEID] returns the UNID of the document instead of a field or column value.
You can also find the documentation online at the Information Center:
http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.designer.domino.main.doc/H_DBLOOKUP_NOTES_DATABASES.html
Related
I am working on some LotusScript code and came across this syntax to access a text field value: textField(0). I checked this field's properties in the design and it has the type of Text and doesn't allow multiple values. But why do we use the index to access this field value? I need to describe what the code is doing so it makes a difference between "get the value of textField then do something" vs. "get the first element of textField then do something".
The LotusScript expression document.textField is a shorthand form of document.GetItemValue("textField"). As explained in Designer Help, this expression always returns an array of strings for text or text list fields. That's why one has to use document.textField(0), or document.GetItemValue("textField")(0) for that matter, to access the first (and possibly only) element in the returned array.
An important thing to remember is that just because the field properties say that multiple values aren't allowed today, they might have been allowed in the past. Nothing gets "fixed up" in old documents if you change the properties in Domino Designer. Your code always has to consider that possibility.
And for that matter, even when the field properties do say that multiple values aren't allowed, those properties only apply when a user is editing the document using the defined form. An agent or code using any of the Notes APIs can always store multiple values in any text field.
That's why you always access item values through an array. It's not just a matter of "that's how the API works". It's a matter of how the underlying storage works.
And remember: Notes is schemaless. You have to always assume the following:
The item that corresponds to the field might not exist.
The item might be empty even if there's a validation formula that requires it to be filled in.
The item that corresponds to a text field might not actually be a text item.
The item can contain a list even if the multi-values property is not checked.
I am working on a suitelet, I have a working version in 1.0 but I need to convert to 2.0 as 1.0 lacks facility. In short, I choose an item, locate assembly items that contain it, I select a checkbox for each assembly I want to modify, I then select an item to replace the original item with. In the 1.0 I had a saved search that joined the item through the "member" sublist, I also pulled in the "line" that it was on. In 2.0 I can't seem to access the joined columns from the search, which I used to filter by the identifier 'memberitem' and pass in the internalid of the item. But for some reason it errors and states that it is "An nlobjSearchFilter contains invalid search criteria: memberitem." This is the column that is available in 1.0 to filter by item. Any help with this is appreciated.
Here is a sample of the 2.0 search. Nothing really changed with the columns and filters, so you should be able to just copy those over to the 2.0 search.
search.create({
type:search.Type.CUSTOMER,
title:'test Search',
id:'customsearch_testsearch',
columns:['internalid','someOtherColumn'],
filters:['parent','anyof',parentID]
});
Here is the URL to the docs (N/search Module). Hope this helps. Not much more I can do without a sample of the existing code.
On a side note, here is the doc that shows what type of search operators can be used with what types of fields: Search Operators. The field memberitem is a select list, so you can only use anyof or noneof with that field.
I have an xpage inside an indexed Lotus Notes database. There is a view control on the xpage (its data source being a Notes view), and since I plan to add a search text field to the xpage, I have been testing the view control "search" property (data\data\search). The documents on the database have text, date and numeric fields. When I look for something located on one of the text fields (e.g., koala), it works, but when I look for a date or a number no documents are found.
I wonder if this could be a localization problem, since in Spain we write the dates with format dd/mm/yyyy and the decimal character in numbers is the comma, but I also tried searching with format mm/dd/yyyy and using the point for decimals, and still no results are retrieved.
I also tried changing the searchFuzzy property on the view control, but nothing changed.
Thanks a lot,
Carlos
Can you post the search syntax you're using? It's hard to diagnose the exact cause. Dates and times definitely work in full text searches.
I'm sorry in advance if you've already excluded any of these. The page in the Notes Help entitled "How can I refine a search query using operators" defines the correct syntax for full text searching, that will allow you to confirm you've got the right syntax.
Also, try doing the same search in the search bar of a view in Notes client. That will help diagnose if it's a problem with search criteria or XPages. (I've used searches in a variety of databases and I'm not aware of any specific problems in XPages.)
Also, have the field data types changed or do you use the same field name for different data types. Notes holds a separate table of the data type assigned to a field name. Once a document is created that has that field, that's the data type used for full text searching. It's not form specific. So if you have a field MyDate that's text on one form and date on another, you can't search both ways. http://www.intec.co.uk/full-text-search-musings/
I have a form. When I open the form the two fields called office and group should be picked up from another database named something like staff.nsf. The data is picked up based on the applicant name as key. I have included my name in staff database. But the form is not picking up the two fields from the staff database.
The field formula goes like this,
server := #Name([CN]; #Subset(#DbName; 1));
temp:= #If(Applicant != ""; #DbLookup( "" : "NoCache"; server:"Mast\\Staff.nsf";
"ByApplicant";Applicant; 2); "");
#If(#IsError(temp);"";temp)
Is it a system bug? Can anybody help please.
Regards,
Priya
Lotus Notes is more than 20 years old, and extremely well-tested. It is very unlikely that you have found a "system bug". There are any number of possible problems here, and you need to carefully rule them out until you find the actual problem.
The first thing you should do is take the #IsError out of the formula (temporarily). By having it there, you are suppressing a potentially useful error message. Ok... admittedly the error messages are usually not that helpful, but sometimes they are. If you don't want to take it out of your formula, just add another computed-for-display field with just the #DbLoookup -- and follow Ken's advice about hard-coding everything.
Then review all of the following:
Is "mast\staff.nsf" the correct path for the database?
Do you have access to the database?
Is "ByApplicant" the correct name for the view? (Spelling errors happen!)
Do you have access to the view?
Do you have access to the documents in the view?
As Ken mentioned, is the first column in the ByApplicant view sorted?
Is the name value you are passing for Applicant in the exact same format that appears in the view column? (I.e, if it appears in abbreviated form in the view column, make sure that you are passing it to #DbLookup in abbreviated format.)
Does the second column of the view contain the value that you are trying to read? (Check out the rules for counting columns in the documentation for #DbLookup.)
A few thoughts:
The ByApplicant view needs to have its first column sorted alphabetically and that column should be the list of applicant names you are matching on
Try hard coding the value for applicant in the #DBLookup to see if it works, and to rule it out as the problem.
This does not work on the web, only on the client (I believe)
When I add a new column to a list in WSS3 (SP2, note: not MOSS), the search feature cannot find items by the values in those columns.
What I've done:
Added an issues list (built in)
Added a column called customid of type number to the list
Added a column called customref of type text (single line) to the list
When I add items, the search feature detects them (after indexing is run) by the title, Issue ID (built in), and customref. However, when I search by the customid, it returns no results.
I cannot find any documentation online which indicates that this is a limitation of WSS3.
Does anyone have any idea why this is happening?
Your time is much appreciated
basically you would have to create a managed property to achieve the functionality you are looking for but i'm afraid that you can not achieve in WSS alternatively you can use search server which is also a free you can find more details about search server at following links
http://technet.microsoft.com/en-us/library/dd183108(v=Office.12).aspx
http://technet.microsoft.com/en-us/library/cc297193(v=office.12).aspx