Unlocked Time Period
The unlocked time period record is available only when the Weekly Timesheets feature is enabled and the Lock Timesheet Period accounting preference is set to lock timesheets after a specified time.
For help working with timesheet locking in the UI, see Locking Timesheet Periods.
The internal ID for this record is unlockedtimeperiod
.
For information about scripting with this record in SuiteScript, see the following help topics:
Supported Script Type
The unlocked time period record is scriptable in both client and server SuiteScript.
Supported Operations
This record can be created, read, updated, deleted, copied, and searched using SuiteScript. It cannot be transformed.
Usage Notes
When creating a new unlocked time period, you should not create a record for an employee that overlaps the date range of an existing active time period for the same employee.
The System Notes sublist is search only.
Field Definitions
See the SuiteScript Records Browser for all internal IDs associated with this record.
Data about unlocked time periods is also accessible through SuiteAnalytics Connect. The records exposed in SuiteAnalytics Connect are available in the Connect Browser. You can retrieve data for unlocked time periods by using the Unlocked Time Periods table as listed in Connect Schema. For more information, see Working with the Connect Browser and SuiteAnalytics Connect.
Code Samples
The following sample shows how to create an unlocked time period.
require (['N/record', 'N/format'], function (record, format){
var unlockTime = record.create ({
type: record.Type.UNLOCK_TIME_PERIOD,
isDynamic: true
});
unlockTime.setValue({
fieldId: 'entity',
value: -5
});
unlockTime.setValue({
fieldId: 'startdate',
value: format.parse({
value: "6/7/2019",
type: format.Type.DATE
})
});
unlockTime.setValue({
fieldId: 'enddate',
value: format.parse({
value: "6/9/2019",
type: format.Type.DATE
})
});
unlockTime.setValue({
fieldId: 'validuntil',
value: format.parse({
value: "6/29/2019",
type: format.Type.DATE
})
});
unlockTime.save();
})