troubleshooting Question

Field is too large (32K) error on specific documents when exporting data

Avatar of Darude1234
Darude1234Flag for Netherlands asked on
Lotus IBM
19 Comments3 Solutions510 ViewsLast Modified:
I'm trying to export Lotus Notes Data to csv and especially the universal id's with the username.
I've already managed to export the documents and also managed to export many of the fields through other agents but i'm now trying to export the unique id's of the documents with the shortname if available or else the reader of the document.
It works: The data is exporting, but the problem i'm facing is that after about 4 hours of exporting the agent stops with an error:
"Notes error: Field is too large (32K) or View's column & selection formulas are too large"

And I can't find a way to skip the specific document and suppress this warning.
I've also tried to log the universal id of the document, but the universal id's that were last logged (and are next to it) don't give me an error when I open the documents.
I've already done a compact & fixup on the database, and also tried to copy the database to local and run it again (as some posts say it should help), but all have not lead to a solution.

Can someone tell me how i can find the related document and fix the field (ideally)?
Or else: Is there a way to just skip the document if this error occurres and go on to the next document?
I expected that 'On error resume nextdoc' would suppress the error, but this didn't make any sense and the error is still popping up.

This is the Agent i'm currently using (I'm not an expert in Lotusscript so it may be a bit messy):

Private Const MODULE 	= "Agent: Export-document-unique-ids-with-shortname"

Sub Initialize()
	On Error GoTo ErrorHandler
	Set AppLog 	= New ErrorLog(MODULE)
	Call AppLog.LogAction("Agent has started")
	Dim ses		As New NotesSession
	Dim dbProj As New NotesDatabase("SERVER/ORG","Apps\Application.nsf")	
	Dim colProj	As NotesDocumentCollection
	Dim docProj	As NotesDocument
	Dim strSearch	As String
	Dim fileNum As Integer
	Dim fileName As String
	fileNum% = FreeFile()
	fileName$ = "c:\temp\export_universalids_with_shortname.csv"
	strSearch	= {(Form="fmDocument" | Form="fmEmployee") & (DocDeleted <> "1" & DocDeleted <> "2") & !@IsAvailable($Conflict)}
	Set colProj	= dbProj.Search(strSearch,Nothing, 0)
	Set docProj	= colProj.GetFirstDocument()

	Dim LineToWrite As String
	Dim row As Integer
	row = 0
	Open fileName$ For Output As fileNum%
	LineToWrite = "DocUniversalID;ShortName;UserName"
	Print #fileNum%, LineToWrite
	LineToWrite = ""
	Do While Not docProj Is Nothing
		If(docProj.HasItem("ShortName")) Then
			Call AppLog.LogAction(docProj.UniversalID & CStr(docProj.getItemValue("ShortName")(0)))
			LineToWrite = CStr(docProj.UniversalID) & ";" _
			& CStr(docProj.getItemValue("ShortName")(0)) & ";"
			If(docProj.HasItem("DocReaders")) Then
				LineToWrite = LineToWrite & CStr(docProj.getItemValue("DocReaders")(0)) & ";"
				LineToWrite = LineToWrite & ";"
			End If
		ElseIf(docProj.HasItem("DocReaders")) Then
			Call AppLog.LogAction(docProj.UniversalID & CStr(docProj.getItemValue("DocReaders")(0)))
			LineToWrite = CStr(docProj.UniversalID) & ";" _
			& CStr(docProj.getItemValue("DocReaders")(0)) & ";"
			If (docProj.HasItem("UniversalID")) Then
				Call AppLog.LogAction(docProj.UniversalID & "- No fields available")
				LineToWrite = CStr(docProj.UniversalID) & ";" _
				& ";"
				Call AppLog.LogAction("Nothing available")
				LineToWrite = ""
			End If	
		End If
		If (LineToWrite <> "")Then
			Print #fileNum%, LineToWrite
		End If
		Set docProj	= colProj.GetNextDocument( docProj)
	Close fileNum%
	Call AppLog.LogAction("File saved in: " & fileName)
	Call AppLog.LogAction("Agent has ended")
	'Close fileNum%
	Exit Sub
	Call AppLog.LogError(Err, Error$ & " in " & MODULE & "." & GetThreadInfo(LSI_THREAD_PROC) & " line " & Erl)
	Resume NextDoc	
End Sub
Sjef Bosman
Groupware Consultant

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 19 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 19 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros