FNP8_UpdateContent

Syntax

 bool FNP8_UpdateContent ()

Parameters

None. The page property "PageName" is used.

Returns

False if any errors occur, or if the action is run on any level that is not document or page level. Otherwise, True. If successful, each page uploaded has a variable “Doc_ID” set to the FileNet object identifier for the new version of the document.

Level

Document and Page level. To ensure proper handling of P8 documents with multiple content elements, this action must be run at Document level and with FNP8_MultiPageDocs("True")

Details

This action is similar to FNP8_Upload, except that FNP8_UpdateContent checks in the file as a new version of an existing FileNet P8 document. (In contrast, FNP8_Upload creates a new FileNet P8 document.)

Note: This action also adds redactions to the existing FileNet P8 document (if any fields have been redacted). If you only want to add redactions, without updating content, then use the action: FNP8_AddRedactionsToP8Document.
Important: This action can only be used for documents that were downloaded by FNP8_SearchAndDownload action, or those that have filenames beginning with the P8 object ID. The Scan action parses the first part of the filename and saves it as a page-level variable named "PageName". The FNP8_UpdateContent action uses the "PageName" variable as the object ID to find the FileNet P8 document to be updated.

Example filename: "{3054025F-0000-CE12-B41A-7B2661D28802}.APT008.tif"

The way in which the action finds the object ID for the FileNet P8 document depends on the level at which it is run:

  • If run at page-level, the action uses the "PageName" variable on the current page.
  • If run at document-level, the action uses the "PageName" variable on the first page of the current document.
Important: Handling of P8 documents with multiple content elements

A document in FileNet P8 can have one or more content elements. In order to update P8 documents with multiple content elements, the FNP8_UpdateContent action must be run at the Document-level and the content elements must correspond to pages of the same document in the Datacap document hierarchy. In addition, the FNP8_MultiPageDocs("True") should be invoked prior to invoking FNP8_UpdateContent. Do not use the FNP8_UpdateContent action at Page-level for P8 documents with multiple content elements.

Versioning

If the FileNet P8 document class has versioning-enabled, then the new content is checked in as a new major version (the prior version is superceded).

If the FileNetP8 document class has versioning-disabled, then the action returns False to indicate that the document content cannot be updated. (FileNet P8 does not allow the document content to be updated for documents with versioning-disabled.)

Handling of P8 documents that are already checked out

The action returns False if called for a P8 document that is already checked out, either by default or if the action FNP8_SetOverrideCheckoutOnUpdateContent(false) is called prior to FNP8_UpdateContent.

If the action FNP8_SetOverrideCheckoutOnUpdateContent(true) is called prior to FNP8_UpdateContent and the P8 document is already checked out, then the action skips the checkout process and attempts to checkin the document with the new content. This works if the P8 user has permission to perform the checkin.

When used with FNP8_UpdateProperties

If this action is used in the same application as the action FNP8_UpdateProperties, it is recommended that FNP8_UpdateProperties should be run before FNP8_UpdateContent. For example, if FNP8_UpdateProperties is run on page-level on "Open", then FNP8_UpdateContent should be run on "Close" for page-level or document-level. This ensures that the property changes made by FNP8_UpdateProperties are included in the current version of the document which is created by FNP8_UpdateContent.

Example 1
......
FNP8_SetSearchClass("Invoice")
FNP8_SetSearchDownloadDir("C:/mylocaldir")
FNP8_SetSearchWhereClause("DocumentTitle LIKE '2017-Invoices%'")
FNP8_SearchAndDownload()
Scan()
......
dcpdf_SetTitle("CarRental")
dcpdf_MakePDFDoc("true")
rrSet("@D.ID+.pdf", "@D.PDFFileName")
FNP8_SetFileType("pdf")
FNP8_SetUploadMode("PDFFileName")
FNP8_UpdateContent()

This example downloads Invoice documents from the P8 repository and ingests the documents into Datacap. It then converts the images to searchable PDF format files, and updates the P8 documents with the new PDF files.

Example 2
......
FNP8_SetSearchClass("Invoice")
FNP8_SetSearchDownloadDir("C:/mylocaldir")
FNP8_SetSearchWhereClause("DocumentTitle LIKE '2017-Invoices%'")
FNP8_SearchAndDownload()
Scan()
...... run the actions below on the Document level ....
TifMerge_SetFileName("@BATCHID+@ID+@DATE(dd.mm.yyyy)")
TifMerge_SetFilePath("@APPVAR(values/gen/MergeFileTempDir)")
TifMerge_MergeImages("Rental_Agreement,Optional_Insurance")
FNP8_MultiPageDocs("True")
FNP8_UpdateContent()

This example downloads Invoice documents from the P8 repository and ingests the documents into Datacap. It then merges the images (from the same document) into a multi-image Tiff file and updates the content of the P8 documents with the new Tiff file.