Skip to content

$p.id

Overview

Gets the site ID or record ID.

Syntax

JavaScript
$p.id()

Parameters

None

Return Value

The return value differs depending on the screen where it is executed, as shown below.

Screen Return value
Edit screen of an existing record Record ID
New record creation screen Site ID
Analysis chart Site ID
Burndown chart Site ID
Calendar Site ID
Crosstab Site ID
Gantt chart Site ID
Index Site ID
Kanban Site ID
Time series chart Site ID

Usage Examples

(1) Log in as the account manager and create a table.

(2) Create a new "Script" and enter the following script content. Check "All" for the output destination and update it.

JavaScript

$p.events.after_set_Update = function () {
    $p.setMessage('#Message', JSON.stringify({
        Css: 'alert-success',
        Text: 'The record ID is [' + $p.id() + '].'
        })
    );
}

(3) Update any record and verify that a message is displayed at the bottom of the screen.

Code Samples

Note

Modify 【 ... 】 in the code as necessary.

1. Check for Duplicates by a Combination of Multiple Columns

This sample is in the sample code of "$p.on".

2. Duplicate Check Limited to the Title, the Same Month, and Your Own Entries

This sample is in the sample code of "$p.events.before_validate".