KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: View Pro Export and Import Callback Methods
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: June 28, 2022

The View Pro Area is a Web Area running SpreadJS, as such, it does not have many 4D native form event triggers. One trigger that may be desired is one for when a document has been completed being exported or imported.

When one of the document importing or exporting commands are called with a PDF or Excel format document, the process is asynchronous and just continues on without making sure that the action is completed or not. This can possibly cause issue if the document is larger and requires more time to complete and the next set of code is reliant on the export's or import's result.

To handle these cases, the export and import commands allow for a callback formula to be applied in the parameter object of options. In the object set method as a Formula to the "formula" property. This method will then be called when the command completes.

Example:

$paramObj:=New object
$paramObj.formula:=Formula(myCallbackMethod)

VP IMPORT DOCUMENT("ViewProArea"; $pathExcelDoc_t; $paramObj)


See Also:
VP EXPORT DOCUMENT
VP IMPORT DOCUMENT