Class

Entry

Entry()

Class representing an entry from Contentstack UI. Not available for Dashboard Widget extension.
Constructor

# new Entry()

View Source entry.ts, line 4

Members

# content_type

View Source entry.ts, line 8

Object

# content_type

Gets the content type of the current entry.

View Source entry.ts, line 20

ContentType

# content_type

View Source entry.ts, line 210

string

# locale

Gets the locale of the current entry.

View Source entry.ts, line 29

Methods

# getData() → {Object}

Gets data of the current entry.

View Source entry.ts, line 216

Returns entry data.
Object

# getField(uid) → {Object}

Gets the field object for the saved data, which allows you to interact with the field. This object will have all the same methods and properties of extension.field. Note: For fields initialized using the getFields function, the setData function currently works only for the following fields: as single_line, multi_line, RTE, markdown, select, number, boolean, date, link, and extension of data type text, number, boolean, and date.
Parameters:
Name Type Description
uid string Unique ID of the field
options.useUnsavedSchema boolean If set to true, the field will get the unsaved field

View Source entry.ts, line 231

Field object
Object
Example
var field = entry.getField('field_uid');
var fieldSchema = field.schema;
var fieldUid = field.uid;
var fieldData = field.getData();

# onChange(callback)

The field.onChange() function is called when another extension programmatically changes the data of the current extension field using the field.setData() function. This function is only available for extension fields that support the following data types: text, number, boolean, or date.
Parameters:
Name Type Description
callback function The function to be called when an entry is edited/changed.

View Source entry.ts, line 243

# onPublish(callback)

The onPublish() function executes the callback function every time an entry has been published with the respective payload.
Parameters:
Name Type Description
callback function The function to be called when an entry is published.

View Source entry.ts, line 249

# onSave(callback)

This function executes the callback function every time an entry is saved.
Parameters:
Name Type Description
callback function The function to be called when an entry is saved.

View Source entry.ts, line 237

# onUnPublish(callback)

The onUnPublish() function executes the callback function every time an entry has been unpublished with the respective payload.
Parameters:
Name Type Description
callback function The function to be called when an entry is un published.

View Source entry.ts, line 255