Skip to content

view.AddColumnPlaceholder

Overview

This is the "AddColumn Placeholder Method" of the "view object". It is used to specify a dynamic "Column Name" in the placeholder of "OnSelectingWhere" in "Extended SQL" in "Server Script".

Limitations

  1. No string other than the "Column Name" may be specified.

Syntax

view.AddColumnPlaceholder(placeholder, columnName);

Parameters

No Parameter Type Required Overview
1 placeholder string Yes Placeholder
2 columnName string Yes "Column Name"

Return Value

There is no return value.

Usage Examples

In the following example, the "Extended SQL" where Name is SelectingWhereName is applied to users other than user ID 3. In addition, the placeholder string {{DynamicColumn}} in the SQL is replaced with ClassA before execution.

Extended SQL
{
    "Name": "SelectingWhereName",
    "SpecifyByName": true,
    "OnSelectingWhere": true,
    "CommandText": "(\"Results\".\"Status\"=900 and \"Results\".\"ClassB\"={{DynamicColumn}})"
}
JavaScript
if (context.UserId !== 3) {
    view.OnSelectingWhere = 'SelectingWhereName';
    view.AddColumnPlaceholder('DynamicColumn', 'ClassA');
}

Supported Versions

  1. Pleasanter 1.2.2.0 or later
  2. Pleasanter .NET Framework version 0.50.265.0 or later