Skip to main content
REMINDER: On December 1, 2018, this forum will be closed to new posts and responses. After that date, you will still be able to view and search the forum. New discussions should take place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

Sign in to participate 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 Generic Notes Developer on 09/03/2018

Status: Open
Comments:

Refresh Rich Text \ Agent needs run... (Generic Notes D... 3.Sep.18)
. . Dunno, never had to run something 3... (Mike Woolsey 18.Sep.18)




Printer-friendly

Search this forum


Sign In or Register

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support


 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite