View

View Overview

The Sapphire View tool enables the user to embed advanced spreadsdheet features in their forms. A spreadsheet is an accounting tool or application that allows for the storage, organisation and analysis of data and displays it in a table format. A spreadsheet is comprised of a number of cells in which information or numerical data can be entered into, calculations executed or display pictures.

The Sapphire Cal tool gives the SapphireOne user the ability to insert and display a spreadsheet area in your SapphireOne forms. Once you use SapphireOne View areas in your forms, you can import and export spreadsheets documents using the SapphireOne View commands. When executed in forms, SapphireOne View areas provide basic spreadsheet features including cell editing and formula entry. More advanced features are available through the SapphireOne View language.

The Sapphire View tool is found on all tools menus in SapphireOne. The user should note that the Sapphire Tools menu from Query by Formula, through to Custom List Report has the same tools on it throughout SapphireOne when any list is being displayed. These are referred to as Common tools.

Sapphire Web Pack View is a functionality and a SapphireOne form area that enables developers to embed advanced spreadsheet features in their forms. 

Installation and Activation  

Unlike with the legacy SapphireOne View product, SapphireOne View features are directly included in SapphireOne itself, making it easier to deploy and manage. No additional installation is required.

However, SapphireOne View requires the same license as SapphireOne View. You need to have this license installed in your application in order to use these features. When the SapphireOne View license is not installed, the contents of an object that requires a SapphireOne View feature are not displayed at runtime and an error message is displayed instead.

In this example, a SapphireOne View license is missing while displaying a SapphireOne View spreadsheet area:

Defining a SapphireOne View Area

Overview  

SapphireOne View allows you to insert and display a spreadsheet area in your SapphireOne forms. A spreadsheet is an application containing a grid of cells into which you can enter information, execute calculations, or display pictures.

Once you use SapphireOne View areas in your forms, you can import and export spreadsheets documents using the SapphireOne View commands.

Creating the Area  

SapphireOne View documents are displayed and edited manually in a SapphireOne form object named SapphireOne View. This object is available as part of the last tool (Plug-in Area, Web Area, etc.) found in the object bar:

A SapphireOne View form area is configured by means of standard properties found in the Property List, such as Object Name and Variable or ExpressionCoordinatesDisplayAction, and Events

  • Object Name: name of the SapphireOne form area that contains and displays the SapphireOne View document.
  • Variable or Expression: name of the SapphireOne View form area variable.

When the form is executed, the SapphireOne View area displays a spreadsheet by default:

Using a SapphireOne View Area

Overview  

When executed in forms, SapphireOne View areas provide basic spreadsheet features including cell editing and formula entry. More advanced features are available through the SapphireOne View language.

Selection, Input and Navigation Basics  

Spreadsheets are composed of rows and columns. A number is associated with each row. A letter (or group of letters once the number of columns surpasses the number of letters in the alphabet) is associated with each column. The intersection of a row and a column makes a cell. Cells can be selected and their contents edited.

Selection  

  • To select a cell, simply click on it or use the direction arrows on the keyboard. Its content (or formula) is displayed within the cell. 
  • To select several continuous cells, drag the mouse from one end of the selection to the other. You can also click on the two ends of the selection while holding down the Shift key.
  • To select all cells in the spreadsheet, click on the  cell at the top left of the area. 
  • To select a column, click on the corresponding letter (or set of letters).
  • To select a row, click on the corresponding number.
  • To select a group of cells that are not continuous, hold down the Ctrl key (Windows) or Command key (Mac) and click on each cell to be selected. 
  • To deselect cells, simply click anywhere within the spreadsheet.

Input and Navigation  

Double-clicking on a cell allows passing into input mode in the relevant cell. If the cell is not empty, the insertion cursor is placed after the content of the cell. 

Data can be entered directly once a cell is already selected, even if the insertion cursor is not visible. The input then 
replaces the content of the cell.

The Tab key validates the cell input and selects the cell to its right. Combining the Shift + Tab keys validates the cell input and selects the cell to its left. 

The Carriage return key validates the cell input and selects the cell below it. Combining the Shift + Carriage return keys validates the cell input and selects the cell above it. 

The direction keys (arrows) allow you to move a cell in the direction indicated by the arrow.

User Interfaces  

You can add an interface to SapphireOne View areas to allow end users to perform basic modifications and data manipulations. SapphireOne offers two optional interfaces to choose from, Ribbon and Toolbar. These interfaces can be enabled or disabled from either the Property List or dynamically with code:

  • Property List: In the Appearance section. 
  • Dynamically: Via a JSON file (see Dynamic Forms)
    • “userInterface”: Default value is “none”. To enable a toolbar, it can be set to “ribbon” or “toolbar”.
    • “withFormulaBar”: Default value is “false”. To enable the formular bar, it can be set to “true” . Note: Available only for the “toolbar” interface. 

Both the Ribbon and the Toolbar interfaces group related actions into the following tabs: 

Tab  Actions Ribbon Interface Toolbar Interface
File File manipulation  X  
Home Text appearance  X  X
Insert Add items  X  X
Formulas Formula calculation and library  X  X
Data Data manipulation  X  X
View Visual presentation  X  X
Settings Sheet presentation reference  X  

User-defined modifications are saved in the SapphireOne View object when the user saves the document.

Ribbon  

The Ribbon interface allows end users to perform comprehensive modifications and data manipulations

Toolbar  

The Toolbar interface allows end users to perform basic modifications and data manipulations. 

Enabling the Toolbar interface displays the Show Formula Bar option. When selected, the formula bar is visible below the Toolbar interface. If not selected, the formula bar is hidden.

With visible formula bar:

Entering a Formula, a Function or a Reference  

To enter a formula or a function in a SapphireOne View area:

  1. Select the cell into which you will enter the formula or function.
  2. Enter = (the equal sign).
  3. Enter the formula.
    OR
    Click on a cell to enter its reference in the formula.

    OR
    Type the first letter of the function to enter. A pop-up menu listing the availables functions and references appears, allowing you to select the desired elements:

Context Menu  

SapphireOne View areas benefit from an automatic context menu that provides users with standard editing features such as copy and paste, but also with basic spreadsheet features:

Note: The Copy/Cut and Paste features of the context menu only work within the spreadsheet area, they do not have access to SapphireOne pasteboard. System shortcuts such as Ctrl+c/Ctrl+v works however and can be used to exchange data between the area and other applications.

This menu proposes additional features depending on the clicked area:

  • click on a column or row header: InsertDeleteHide, or Unhide the contents
  • click on a cell or a cell range: 
    • Filter: allows hiding row through filters (see Filtering rows in the SpreadJS documentation).
    • Sort: sorts the column contents.
    • Insert Comment: allows user to enter a comment for an area. When a comment has been entered for an area, the top left cell of the area displays a small red triangle:

SapphireOne View Form Events  

Overview  

The following form events are available in the Property List for SapphireOne View areas:

Some of the events are standard form events (available to all active objects) and some are specific SapphireOne View form events. The specific SapphireOne View form events provide additional information in the object returned by the FORM Event command when they are generated for SapphireOne View areas. The following table shows which events are standard and which are specific SapphireOne View form events:

Standard SapphireOne events (see Form event code) Specific SapphireOne View events
On Load   On VP Ready
On Getting Focus  On Clicked
On Losing Focus   On Double Clicked
On Unload   On Header Click
  On After Edit
  On Selection Change
  On Column Resize
  On Row Resize
  On VP Range Changed

On VP Ready  

Any SapphireOne View area initialization code, for loading or reading values from or in the area, must be located in the On VP Ready form event of the area. This form event is triggered once the area loading is complete. Testing this event makes you sure that the code will be executed in a valid context. An error is returned if a SapphireOne View command is called before the On VP Ready form event is generated.

Note: SapphireOne View areas are loaded asynchronously in SapphireOne forms. It means that the standard On load form event cannot be used for SapphireOne View initialization code, since it could be executed before the loading of the area is complete. On VP Ready is always generated after On load.

On Clicked  

Clicking anywhere on a SapphireOne View document generates the On Clicked event. The object returned by the FORM Event command contains:

Property Type Description
code longint On Clicked
description text “On Clicked”
objectName text SapphireOne View area name
sheetName text Name of the sheet of the event
range object Cell range

Example: If(FORM Event.code=On Clicked)
    VP SET CELL STYLE(FORM Event.range;New object("backColor";"green"))
 End if

On Double Clicked  

When a user double clicks anywhere on a SapphireOne View document, the On Double Clicked event is generated. The object returned by the FORM Event command contains:

Property Type Description
code longint On Double Clicked
description text “On Double Clicked”
objectName text SapphireOne View area name
sheetName text Name of the sheet of the event
range object Cell range

Example: If(FORM Event.code=On Double Clicked)
    $value:=VP Get value(FORM Event.range)
 End if

On Header Click  

A user clicking on a column or row header in a SapphireOne View document generates the On Header Click event. The object returned by the FORM Event command contains:

Property Type Description
code longint On Header Click
description text “On Header Click”
objectName text SapphireOne View area name
sheetName text Name of the sheet of the event
range object Cell range
sheetArea longint The sheet location where the event took place: 0: The crossing area between column number/letter headers (top left of the sheet)1: The column headers (area indicating the column numbers/letters)2: The row headers (area indicating the row numbers)

Example: If(FORM Event.code=On Header Click)
    Case of
       :(FORM Event.sheetArea=1)
          $values:=VP Get values(FORM Event.range)
       :(FORM Event.sheetArea=2)
          VP SET CELL STYLE(FORM Event.range;New object("backColor";"gray"))
       :(FORM Event.sheetArea=0)
          VP SET CELL STYLE(FORM Event.range;New object("borderBottom";New object("color";"#800080";"style";vk line style thick)))
    End case
 End if

On After Edit  

Following any user modification in a SapphireOne View document, the On After Edit event is generated. The object returned by the FORM Eventcommand contains:

Property Type Description
code longint On After Edit
description text “On After Edit”
objectName text SapphireOne View area name
sheetName text Name of the sheet of the event
action text “editChange”, “valueChanged”, “DragDropBlock”, “DragFillBlock”, “formulaChanged”, “clipboardPasted”

Note: See also the On VP Range Changed event.

Depending on the action property value, the object will contain additional properties.

action = editChange  

Editing text generates the following additional properties:

Property Type Description
range object Cell range
editingText variant The value from the current editor

action = valueChanged  

Changing value(s) generates the following additional properties: 

Property Type Description
range object Cell range
oldValue variant Value of cell before change
newValue variant Value of cell after change

action = DragDropBlock  

Dragging and dropping actions generate the inclusion of the following additional properties:

Property Type Description
fromRange object Range of source cell range (being dragged)
toRange object Range of the destination cell range (drop location)
copy boolean Specifies if the source range is copied or not
insert boolean Specifies if the source range is inserted or not

action = DragFillBlock  

Dragging content to fill adjacent cells generates the following additional View:

Property Type Description
fillRange object Range used for fill 
autoFillType longint Value used for the fill. 0: Cells are filled with all data (values, formatting, and formulas)1: Cells are filled with automatically sequential data2: Cells are filled with formatting only3: Cells are filled with values but not formatting4: Values are removed from the cells5: Cells are filled automatically 
fillDirection longint Direction of the fill. 0: The cells to the left are filled1: The cells to the right are filled2: The cells above are filled3: The cells below are filled

action = formulaChanged  

Entering formula(s) generates the following additional properties:

Property Type Description
range object Cell range
formula text The formula entered 

action = clipboardPasted  

Pasting content from the clipboard generates the following additional properties:

Property Type Description
range object Cell range receiving the contents
pasteOption longint Specifies what is pasted from the clipboard: 0: Everything is pasted (values, formatting, and formulas)1: Only values are pasted2: Only the formatting is pasted3: Only formulas are pasted4: Values and formatting are pasted (not formulas)5: Formulas and formatting are pasted (not values)
pasteData object The data from the clipboard to be pasted
   Property Type Descriptiontext textThe text from the clipboardhtml textThe HTML from the clipboard

Example  

Here is an example handling an On After Edit event: If(FORM Event.code=On After Edit)
    If(FORM Event.action="valueChanged")
       ALERT("WARNING: You are currently changing the value from "+String(FORM Event.oldValue)+" to "+String(FORM Event.newValue)+"!")
    End if
 End if

The above example could generate an event object (see FORM Event) like this:
{
"code":45;
"description":"On After Edit";
"objectName":"ViewProArea"
"sheetname":"Sheet1";
"action":"valueChanged";
"range": {area:ViewProArea,ranges:[{column:1,row:2,sheet:1}]};
"oldValue":"The quick brown fox";
"newValue":"jumped over the lazy dog";
}

On Selection Change  

Modification of the current selection of rows or columns in a SapphireOne View document generates the On Selection Change event. The object returned by the FORM Event command contains:

Property Type Description
code longint On Selection Change
description text “On Selection Change”
objectName text SapphireOne View area name
sheetName text Name of the sheet of the event
oldSelections object Cell range before change. 
newSelections object Cell range after change. 

Example: If(FORM Event.code=On Selection Change)
    VP SET CELL STYLE(FORM Event.oldSelections;New object("backColor";Null))
    VP SET CELL STYLE(FORM Event.newSelections;New object("backColor";"red"))
 End if

On Column Resize  

When a user modifies the width of a column in a SapphireOne View document, the On Column Resize event is generated. The object returned by the FORM Event command contains:

Property Type Description
code longint On Column Resize
description text “On Column Resize”
objectName text SapphireOne View area name
sheetName text Name of the sheet of the event
range object Cell range of the columns whose widths have changed
header boolean True if the row header column (first column) is resized, else false

Example: If(FORM Event.code=On Column Resize)
    VP SET CELL STYLE(FORM Event.range;New object("hAlign";vk horizontal align right))
 End if

On Row Resize  

A user modifying the height of a row in a SapphireOne View document generates the On Row Resize event. The object returned by the FORM Eventcommand contains:

Property Type Description
code longint On Row Resize
description text “On Row Resize”
objectName text SapphireOne View area name
sheetName text Name of the sheet of the event
range object Cell range of the rows whose heights have changed
header boolean True if the column header row (first row) is resized, else false

Example: If(FORM Event.code=On Row Resize)
    VP SET CELL STYLE(FORM Event.range;New object("vAlign";vk vertical align top))
 End if

On VP Range Changed  

When a change occurs within a cell range in the SapphireOne View document, the On VP Range Changed event is generated. The object returned by the FORM Event command contains:

Property Type Description
objectName text SapphireOne View area name
code longint On VP Range Changed
description text “On VP Range Changed”
sheetName text Name of the sheet of the event
range object Cell range of the change
changedCells object Range containing only the changed View. It can be a combined range. 
action text The type of operation generating the event:”clear” – A clear range value operation”dragDrop” – A drag and drop operation”dragFill” – A drag fill operation”evaluateFormula” – Setting a formula in a specified cell range”paste” – A paste operation”setArrayFormula” – Setting a formula in a specified cell range”sort” – Sorting a range of cells

Converting SapphireOne View Documents  

You can convert your SapphireOne View documents to SapphireOne View areas using the VP Convert from SapphireOne View command. Most properties and information stored in SapphireOne View documents are automatically converted, including formats, styles, borders, values, formulas, selections, zoom, etc. In general, converted SapphireOne View documents will be rendered in SapphireOne View areas exactly as they were rendered in SapphireOne View areas, like the following:

Original SapphireOne View document:

Document converted in SapphireOne View area

We are doing our best to ensure that converted documents remain as true as possible to the original, but some features may not be fully rendered. These are described in the paragraph below.

Conversion Process  

Note: The SapphireOne View document conversion feature is being continuously improved, based on customer feedback. It is highly recommended to always keep a copy of your original SapphireOne View BLOBs or documents, even after a successful conversion. 

With regards to the current state of your SapphireOne View plug-in document, the conversion process requires the following steps.

  1. Load your SapphireOne View document (.4pv) into a BLOB:
    Note: If your SapphireOne View document is already stored in a BLOB field, go to step 2.
     C_BLOB($pvblob)
     DOCUMENT TO BLOB("document.4PV";$pvblob)
  2. Call the VP Convert from SapphireOne View with the BLOB containing the SapphireOne View document:
     C_OBJECT($vpObj)
     $vpObj:=VP Convert from SapphireOne View($pvblob)
  3. Assign the resulting object to a SapphireOne View area form object or a document to see the results. 
     VP IMPORT FROM OBJECT("SapphireOneViewProArea";$vpObj)

Conversion Details  

The following table provides the current status for the primary conversion areas. Note that this list will be updated regularly, as the conversion process is continuously improved. 

Feature Conversion status Comments
Document attributes Document display attributes are converted: selected cells, zoom, grid display.
Document information is converted: version, title, subject author, company, note, creation and modification date.
Columns and rows All defined columns and rows are converted with their original size.
Column and row headers are converted without any restrictions.
Borders Borders are converted with their thickness and color. Grid display settings are converted. Only one single bar border and one double-bar border models are available in SapphireOne View. Single bar borders are converted the same as the original, any double-bar borders are converted to the SapphireOne View double-bar model.
Splitters Currently not converted
Styles & fonts Styles and style sheets are converted. Conditional styles are not supported. Deprecated text styles (i.e. Shadow, Condensed, etc.) and QuickDraw fonts are not converted. 
Rotation styles (oriented text) are currently not converted
Formats & cell names Cell formats are converted to available formats with similar rendering. All data type formats are supported: text, number, date and time, boolean, picture. Cell names are converted. COMPATIBILITY NOTE: As of SapphireOne v17 R5, SapphireOne View default formats rely on the same regional settings as the SapphireOne host database. 
User defined SapphireOne formats (starting with “|”) are currently not converted
Controls created with PV SET CELL CONTROL (button / radio button / check box / drop down / combo box) are currently not supported
Invisible cells are not supported (not available in SapphireOne View) Only columns, rows, or sheets can be set invisible. An alternate solution is to use VP ADD FORMULA NAME to define non-displayed values or formulas.
Pictures Pictures are supported and converted with some limitations SapphireOne View picture format included multiple codecs and is deprecated. Converted pictures keep only the most appropriate codec for html rendering (svg, png, jpeg, gif) and are saved in base64. 
Pictures with truncated centered / replicated format are currently not converted Background pictures are not replicated on each page (this concept does not exist in SapphireOne View).
Printing Currently not supported Printing options and print settings defined in the SapphireOne View document are converted. 
Dynamic links Cells or columns linked to fields or variables are currently not supported
Formulas Formulas are converted but for security reasons, references to SapphireOne project methods, commands, variables, or fields need specific processing (see below) See Converting SapphireOne View plug-in formulas.
Project methods – supported Project methods must comply with SapphireOne View requirements (see Project method references). A non compliant method name is converted to UNSUPPORTED_SapphireOneMETHOD_NAME(“<method name>”,param1,…paramN).
Commands – supported Converted to existing SapphireOne View functions (see Functions and SapphireOne commands). SapphireOne commands that are not part of the authorized list are converted to: UNSUPPORTED_SapphireOneCOMMAND(<command name>,param1,…,paramN). 
Variables – not supported You must use SapphireOne project methods to access variable values (see Project method references). Variables in formulas are converted to UNSUPPORTED_VARIABLE(“<variable name>”).
Fields – supported Converted to “TABLETITLE_FIELDTITLE()” if available in the database during conversion. If a field or table name is not ECMA compliant, converted to UNSUPPORTED_TABLE_FIELD_TITLE(“virtual structure name”). Only fields belonging to the “virtual structure” of the database can be called in SapphireOne View formulas. See Field references.

SapphireOne View Database References

Project method references  

Field references  

Project Method References  

Overview  

SapphireOne View allows you to call SapphireOne project methods from within your formulas. Using SapphireOne project methods extends the possibilities of your SapphireOne View documents. SapphireOne methods can receive parameters from the SapphireOne View area, and return values. For security reasons, only methods that have been explicitly allowed can be called by the user. 

Requirements  

To be called in a SapphireOne View formula, a project method must be:

  • Referenced: it was explicitly declared using the VP SET CUSTOM FUNCTIONS command (recommended) or the VP SET ALLOWED METHODS command.
  • Runnable: it belongs to the host database or a loaded component with the “Shared by components and host database” option enabled (see Sharing of project methods).
  • Not in conflict with an existing SapphireOne View function: if you call a project method with the same name as a SapphireOne View built-in function, the function is called.

Note: If neither the VP SET CUSTOM FUNCTIONS nor the VP SET ALLOWED METHODS command has been executed during the session, SapphireOne View custom functions rely on allowed methods defined by SapphireOne’s generic SET ALLOWED METHODS command. In this case, the project method names must comply with JavaScript Identifier Grammar (see ECMA Script standard). The global filtering option in the Settings dialog box (see Data Access) is ignored in all cases.

Hello World example  

We want to print “Hello World” in a SapphireOne View area cell using a SapphireOne project method:

  1. Create a “myMethod” project method with the following code:
     #DECLARE->$hw Text
     $hw:="Hello World"
  2. In the form method of the form that contains the SapphireOne View area, you can write:
     Case of
        :(Form event code=On Load)
           var $o : Object
           $o:=New object
      // Define "vpHello" function from the "myMethod" method
           $o.vpHello:=New object
           $o.vpHello.formula:=Formula(myMethod)
           VP SET CUSTOM FUNCTIONS("ViewProArea";$o)
     End case
  3. Edit the content of a cell in a SapphireOne View area and type:

    “myMethod” is then called by SapphireOne and the cell displays:

Parameters  

Parameters can be passed to SapphireOne project methods using the following syntax:=METHODNAME(param1,param2,...,paramN)

These parameters are received in methodName in $1, $2…$N.

Note that the ( ) are mandatory, even if no parameters are passed:=METHODWITHOUTNAME()

You can declare the name, type, and number of parameters through the parameters collection of the function you declared using the VP SET CUSTOM FUNCTIONS (or VP SET ALLOWED METHODS) command. Optionally, you can control the number of parameters passed by the user through minParams and maxParams properties.

If you do not declare parameters, values can be sequentially passed to methods (they will be received in $1, $2…) and their type will be automatically converted. Dates in jstype will be passed as C_OBJECT in SapphireOne methods with two properties:

Property Type Description
value Date Date value
time Real Time in seconds

SapphireOne project methods can also return values in the SapphireOne View cell formula via $0. The following data types are supported for returned parameters:

  • C_TEXT (converted to string in SapphireOne View)
  • C_REAL/C_LONGINT (converted to number in SapphireOne View)
  • C_DATE (converted to JS Date type in SapphireOne View – hour, minute, sec = 0)
  • C_TIME (converted to JS Date type in SapphireOne View – date in base date, i.e. 12/30/1899)
  • C_BOOLEAN (converted to bool in SapphireOne View)
  • C_PICTURE (jpg,png,gif,bmp,svg other types converted into png) creates a URI (data:image/png;base64,xxxx) and then used as the background in SapphireOne View in the cell where the formula is executed
  • C_OBJECT with the following two properties (allowing passing a date and time):
    PropertyTypeDescriptionvalueDateDate valuetimeRealTime in seconds

If the SapphireOne method returns nothing, an empty string is automatically returned.

An error is returned in the SapphireOne View cell if:

  • the SapphireOne method returns another type other than those listed above,
  • an error occurred during SapphireOne method execution (when user click on “abort” button).

Field References  

Overview  

SapphireOne View allows you to use references to SapphireOne database fields in your formulas. When displaying a SapphireOne View area, a field reference is replaced by the field value in the current record. The value is extracted when the form is opened, but if it changes you can just call VP RECOMPUTE FORMULAS so that the SapphireOne View area uses the new value.

Requirements  

To be called in a SapphireOne View formula, a SapphireOne field must comply to the following requirements:

  • the field was declared as a formula using the VP SET CUSTOM FUNCTIONS command (see example).
  • the field type must be supported by SapphireOne View (see below).

An error is returned in the SapphireOne View cell if the formula calls a field which is not compliant.

Note: For security when the VP SET CUSTOM FUNCTIONS is not used (not recommended), only the fields belonging to the virtual structure of the database, i.e. declared through the SET TABLE TITLES and/or SET FIELD TITLES commands with the * parameter, can be called. In this case, table and field names must be ECMA compliant (see ECMA Script standard). 

Supported Field Types  

SapphireOne View supports references to fields of the following types:

Type Value type in SapphireOne View
Alpha, Text string
Integer, Long integer, Integer 64-bit, Real, Float number
Date JavaScript Date type (hour, minute, sec = 0)
Time JavaScript Date type (date in base date, i.e. 12/31/1899)
Boolean bool
Picture supported picture types: jpg, png, gif, bmp, svg; other types converted into png. Creates an uri (data:image/png;base64,xxxx) set as background for the SapphireOne View cell where the formula is executed

Example  

We want to print the name of a person in a SapphireOne View area cell using a SapphireOne field:

  1. Create an “Employee” table with a “L_Name” field:
  2. In the form method of the form that contains the SapphireOne View area, you can write:
     Case of
        :(Form event code=On Load)
           var $o : Object
           $o:=New object
           $o.EMP_NAME:=New object //declare the function
           $o.EMP_NAME.formula:=Formula([Employee]L_Name)
           VP SET CUSTOM FUNCTIONS("ViewProArea";$o)
     End case
  3. Edit the content of a cell in the SapphireOne View area and enter “=e”:
  4. Select EMP_NAME (use the Tab key) and enter the closing ). 
  5. Validate the field to display the name of the current employee:

    Note: The [Employee] table must have a current record.

Note: When the VP SET CUSTOM FUNCTIONS command is not used (not recommended), fields declared in the virtual structure are entered with a syntax such as TABLENAME_FIELDNAME()


You can review our Blog and YouTube channel for additional information and resources on SapphireOne ERP, CRM and Business Accounting software.

Was this helpful?

Previous Article

Write

Next Article

Sapphire Custom Report