Skip to content

I want to set a date column to NULL in the API

Answer

Please set a value outside the range of the values ​​set in the "MinTime" and "MaxTime" parameters of the "General.json".


Overview

You can update the date column to NULL by setting a value outside the range of the values ​​set in "MinTime" and "MaxTime" of "General.json" in the "Record Update" of Pleasanter "API".

Script

This is a script that updates DateA to NULL. If "MinTime" and "MaxTime" of "General.json" are set as follows, it will set to "1899/12/31".
MinTime: "1900/1/1"
MaxTime: "2100/1/1"

javascript
$p.apiUpdate({
    id: 123456,
    data: {
        ApiVersion: 1.1,
        DateHash: {
            DateA: '1899/12/31'
        }
    },
    done: function (data) {
        console.log('success!');
        console.log(data);
    },
    fail: function (data) {
        console.log('fail...');
        console.log(data);
    }
});