Type parameters
Hierarchy
- BaseItem<ReminderData>
-
ItemRef<ReminderItem>
- ReminderItem
Properties
Readonly code
App code of the URL’s target (the app’s code).
Readonly data
Values of object’s fields.
Readonly fields
Description of the object’s fields.
Readonly id
ID of the URL’s target.
Readonly namespace
Namespace of the URL target (the code of the workspace that the app belongs to).
Methods
delete
-
Delete a reminder.
In the example, a task search is performed, reminders for the current user are retrieved, and all reminders are deleted:
// Get the task object let task = await System.processes._searchTasks().where(x => x. __id.eq(taskUUID)).first(); //If the task object is not found, stop the script execution if (!task) { return; } // Get the current user const user = await System.users.getCurrentUser(); // Get the current date // The time zone is taken from the field `System.timezones.current` let dateReminder = new Datetime(); // Get all reminders for the user for this task const reminders = await System.reminders.search().where((f,g) => g.and(f .user.eq(user), f.__item.eq(task!))).all(); // Delete all reminders for ( let i = 0; i < reminders.length; i++) { await reminders[i].delete(); }
Returns Promise<void>
fetch
-
Request complete data of a reference object.
Returns Promise<ReminderItem>
normalize
-
Delete duplicate data in arrays.
The method deletes duplicates in fields that store arrays of links to system objects (users, files, app items, or documents). For example, you can call this method after bulk editing data within an object.
const app1 = await Context.data.app1.fetch(); const app2 = await Context.data.app2 .fetch(); app1.data.executors.push(app2.data.executors); app1.normalize(); // Now we need to go over the elements in the new array app1.data.executors .forEach( ... );
Returns void
Reminder object
To create a reminder for a task, the
ProcessTaskItem.createReminder
method.// Get the task object let task = await System. processes._searchTasks().where(x => x.__id.eq(taskUUID)).first(); // If the task object is not found, stop the script execution if (!task) { return; } // Get the current user const user = await System.users. getCurrentUser(); // Get the current date and add one day to it // The time zone is taken from the `System.timezones.current`field let dateReminder = new Datetime(); dateReminder = dateReminder.add(new Duration( 1, 'days')) // Create a reminder for the task on the next day await task. createReminder(dateReminder, user);