Sample Script

Quick Fields contains a powerful Script Editor that enables you to write VB.NET and C# scripts. In the sample script below, a message box is displayed to the user after a page is processed. The code in red represents the custom script.

The method associated with the script's event (OnAfterPageProcessed) accepts a single parameter that is defined for you: e. You can use e to access most of the methods, properties, interfaces, etc. that you will need to interact with the page, document, and session. The options available to you within a script depend on the event you have selected. For example, you cannot access the name of a document class in an event that occurs before the document in question is identified. As another example, you could not use Laserfiche Server Objects to interact with the active document until after it is stored in the repository (until the OnDocumentStored method is called). In addition, the available options also vary depending on whether the event you have selected is associated with a page (e.g., OnPageCreated) or a document (e.g., OnDocumentCreated).

ClosedShow me the script in VB.NET.

ClosedShow me the script in C#.

Tip: For more detailed sample scenarios and code samples, see the white paper on the Laserfiche Support titled Extending Quick Fields 8: Scripting.