I have a need to search the response documents in the domino view by the parent unid
I tried this [$ref]="324BEC7DB47895DEC2258057002E6E98" but don't work. The result is empty.
In my case, there's a concatenation of the couple AND and without [$ref]="324BEC7DB47895DEC2258057002E6E98" it works.
Any [$ref] syntax suggestions?!
You can't search for $REF content.
Get all responses to your document and ftsearch the resulting NotesDocument Collection:
Dim collection As NotesDocumentCollection
Set collection = doc.Responses
Call collection.FTSearch("your search query", 0)
It reduces the collection to documents matching the search query only.
Related
I'm working in several scripts iterating responses collections for main documents which get replicated, and I'm hitting a problem.
If I obtain a NotesDocumentCollection which contains one or more deletion stubs, when I iterate with GetNextDocument I get a NotesDocument object which has no attributes (doc.IsValid is False, doc.IsDeleted is True, and accessing any field or property causes an error and the UniversalID is blank). I cannot use this stub to collect the next document in the collection because I get an error that the document is deleted, nor can I remove it from the collection for the same reason.
What can I do to continue the iteration in the existing collection?
I believe there is an isDeleted property you can check before proceeding the document.
For accessing to collection content I need to know {collection-name} and {document-key}.
How I can get list of all documents with their {document-key} in ArangoDB with http?
In docs there is a GET /_api/document request which will retrieve all documents from collection. If you specify type=key query string parameter then you will get response with an array of document keys.
I have one page that does a NotesDatabase search and of course returns a collection. I am storing that collection in a sessionScope variable and calling a page where I what ti display the results.
if ( collection1.getCount() == 0)
{
displayErrorMsg("Your search returned zero results. Please try another search.",getClientId("title"), "Zero Results");
}
else
{
sessionScope.put("searchResults",collection1);
var extCont = facesContext.getExternalContext();
extCont.redirect("xp_vwIssueSearchResults.xsp");
}
The page has a data table with the content of the scope variable as it's datasource:
sessionScope.get("searchResults");
When I call this page I get, NotesException: Object has been removed or recycled.
Should I be able to pass a NotesDocumentCollection in a sessionScope variable? I have some thoughts on work arounds but it would sure be nice to pass the NotesDocumentCollection.
You can't keep Notes objects like views, documents, collections for a longer time. In general, you should work with Notes object in a way, that you save the data you're interested in somewhere and recycle (=destroy) the Notes objects right away. The reason is that the Domino server can't save the Notes objects for you between two request because Notes objects aren't serializable (serializable = ability to save objects on disk and restore them back to memory).
In your case, you could save
the search query or
the result values as an Array of Objects (JavaScript) or a List of Maps (Java) or
the documentUniqueIDs of document collection's documents
in your sessionScope variable and use them in your redirected page.
I am having some documents. If I try to open the document then it shows error like "field is too large 32k or view's column & selection formulas are too large"
Whenever I try to delete the document, I am getting the same error. I am not able to delete.
Okay we can try to get the document via backend, But there, I can not get the document handle.
Whatever I try to search then the document collection count is 0.
Important:- I am using Notes 6.5.2.
Thanks in Advance,
You may create new replica of the database, currupted documents won't be copied. Also you may try to use ScanEZ tool from Ytria.
"Okay we can try to get the document via backend, But there, I can not get the document handle."
Could you post the code you are using?
I don't see why the following code would not work:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim col As NotesDocumentCollection
Dim doc As NotesDocument
Dim deleteDoc List as NotesDocument
Set db = session.Currentdatabase
'*** Get collection of selected documents
Set col = db.UnprocessedDocuments
'*** Loop through selected documents
Set doc = col.GetFirstDocument
Do Until doc Is Nothing
'*** Add document to list to delete later
Set deleteDoc(doc.UniversalID) = doc
Set doc = col.GetNextDocument(doc)
Loop
'*** Delete all documents in list from database
ForAll d in deleteDoc
Call d.Remove(True)
End ForAll
Perhaps you may want to change the field that causing you headache to rich text since the limit for rich text field is slightly bigger that normal text field. The limit for rich text filed is limited only by available disk space up to 1GB
Have you tried to simply delete the problem field on a corrupt document, and then delete the document? You can try to do the following:
1- create an agent set to run on selected documents with the following formula:
FIELD corruptfield := #DeleteField;
2 - select a problem document in a view and run the agent
3 - if that does not error out, then try to manually delete the document from the view.
Here is what worked for me :
1/ Get the Note ID of the doc with DocViewer
There may be many other ways to get the NoteID, but it just showed up when I tried to send the doc through DocViewer, the well known free tool
https://www.openntf.org/main.nsf/project.xsp?r=project/Document%20Viewer/summary
2/ Remove the doc with Notes C API
I followed the advice of pstr, and quickly found out this script
http://www.nsftools.com/tips/ApiStublessDelete.lss
Just aim it at the good database, with the Note ID, and it does the trick !!
I tried to change the script in order to not remove the deletion stub (I wished the removal would replicate over my cluster and local replica). But you fall back on the 32k error ! So you have to apply the deletion over every replica (or recreate the replicas of course).
I am working on Lotus Notes and I have a document that contains multiple files attached to it. Every attached file has a $File field in back end. I need to have attributes of $File field. Please let me know how can I get attributes of $File field of lotus notes document?
You can get that information using the NotesEmbeddedObject class. Here's an example from the docs:
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Set db = New NotesDatabase( "SanFrancisco", "hill.nsf" )
Set view = db.GetView( "All Documents" )
Set doc = view.GetLastDocument
Forall o In doc.EmbeddedObjects
Messagebox( o.Name )
End Forall
The NotesEmbeddedObject class has properties you can use or you could presumably extract the file and access it from the file system to get more information.
You don't say which attributes you are after in the $File item. You can obtain some information about each attachment as Ken describes. You can also obtain some (probably less useful) information by iterating to them via the Items collection on a NotesDocument. If information obtained those ways is insufficient, you can get to the $File item directly via calls into the Notes API from LotusScript, but that is much more involved and requires unrestricted execution rights by the signer of the code, or possibly by the user herself, depending on context, I believe.
For more precision, tell us yourself more precisely what you're after. Cheers.