Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next
Subject: Refresh Rich Text \ Agent needs running 3 times
Feedback Type: Question
Product Area: Notes Client
Technical Area: Application Development
Platform: Windows
Release: 8.5.2
Reproducible: Always

Hi,
I have code that needs to do the following:

1) Takes a document in, but changes the "form" used, to be the "Table" form (which takes the Rich Text Fields out of the "Table Design" elements and sections, onto a basic document with no formatting (since otherwise I can't process the Rich Text Fields.

2) Then it gets the Rich Text fields, and (if they contain tables) it uses the GetField method to get HTML representations of the fields, then outputs aspx (or html) files.

3) At also processes any attachments on the document.

4) It also writes out a pdf representation of the document (that uses another, different form, which just takes an abstract of the text in the Rich Text fields.

Ultimately I do get the result I want in test however, I have to run the agent 3 times?!?
I thought it was a Refresh issue at one point so I wrote another agent to trigger the main one and do a refresh:
@Command([ToolsRefreshSelectedDocs]);
@Command([ViewRefreshFields]);
@Command([ToolsRefreshSelectedDocs]);
@Command([RunAgent];"UnloadAsPDF13");
@All

Bit reluctant to Share all the code because it's so long (and split into functions), but for example:
Dim olddocAttachments As NotesItem
Dim olddocProjCoordComm As NotesItem
Dim olddocAdminComm As NotesItem

Set olddocAttachments = doc.GetFirstItem( "Attachments" )
Set olddocProjCoordComm = doc.GetFirstItem( "ProjCoordComm" )
Set olddocAdminComm = doc.GetFirstItem( "AdminComm" )

createddoc.Form = "NP&PCSUBTABLE5"
Call createddoc.CopyItem( olddocAttachments , "Attachments" )
Call createddoc.CopyItem( olddocProjCoordComm , "ProjCoordComm" )
Call createddoc.CopyItem( olddocAdminComm , "AdminComm" )
createddoc.Attachments.Update
createddoc.ProjCoordComm.Update
createddoc.AdminComm.Update
Call createddoc.ComputeWithForm( False, False )
'Call createddoc.
Call createddoc.save(True,True)
' Call createddoc.Send("","albutler1@mmm.com")
'if createddoc.
view.Refresh

'db.createdocument
' doc.CopyItem("Attachments")
'doc.CopyItem("ProjCoordComm")
' doc.CopyItem("AdminComm")

'doc.fields = "values"
Call doc.save(True,True)


doc.Form="NP&PCSUBTABLE5"

If(createddoc.HasItem("Attachments")) Then
Set rt1doc = createddoc.GetFirstItem("Attachments")
rt1doc.Update
Call createddoc.Save(True,False,True)
Set rtn1doc = rt1doc.CreateNavigator
End If

' Attachments
If(createddoc.HasItem("Attachments")) Then
Set rt1doc = createddoc.GetFirstItem("Attachments")
rt1doc.Update
Call createddoc.Save(True,False,True)
Set rtn1doc = rt1doc.CreateNavigator
End If


'next field
If(createddoc.HasItem("AdminComm")) Then
Set rt2doc = createddoc.GetFirstItem("AdminComm")
rt2doc.Update
Call createddoc.Save(True,False,True)
Set rtn2doc = rt2doc.CreateNavigator
End If


'next field
If(createddoc.HasItem("ProjCoordComm")) Then
Set rt3doc = createddoc.GetFirstItem("ProjCoordComm")
rt3doc.Update
Call createddoc.Save(True,False,True)
Set rtn3doc = rt3doc.CreateNavigator
End If


Dim lstOfRowNumbers
Dim cellCounter As Integer
cellCounter = -1
Dim empList List As Double

Dim lstOfRowNumbers2
Dim cellCounter2 As Integer
cellCounter2 = -1
Dim empList2 List As Double

Dim lstOfRowNumbers3
Dim cellCounter3 As Integer
cellCounter3 = -1
Dim empList3 List As Double

'Attachments FIELD
'rtn1doc.GetElement
If Not rtn1doc.FindFirstElement(RTELEM_TYPE_TABLE) Then
'Do Nothing
' Messagebox "No tables in the attachments field,",, "No tables"
End If
If rtn1doc.FindFirstElement(RTELEM_TYPE_TABLE) Then
Dim rtt As NotesRichTextTable
Set rtt = rtn1doc.GetElement

Dim labelString As String
labelString = ""

Forall label In rtt.RowLabels
If(label <> "") Then labelString = labelString & Chr(13) & " " & label
cellCounter = cellCounter + 1
empList(cellCounter) = cellCounter
End Forall
End If

'End Attachments FIELD


Feedback number WEBBB49KYS created by ~Evelyn Cisnither on 09/03/2018

Status: Open
Comments:

Refresh Rich Text \ Agent needs run... (~Evelyn Cisnith... 3.Sep.18)
. . Dunno, never had to run something 3... (~Sigmund Umwema... 18.Sep.18)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS