new BackendBaseComponent()

Description

DEPRECATED

This component has been deprecated. Use components in the frontend extensibility API, or SuiteScript 2.0 modules and methods instead.

Base abstract class for SuiteScript-based back-end components. Use method BackendBaseComponent.extend to build a specific component implementation.
For each method defined in a component, an equivalent synchronous method is created automatically. For example, if an implementation has a method foo() that returns a Deferred, and the component extends BackendBaseComponent, an extra method fooSync() is created automatically. The fooSync() method will return the value of the resolved Deferred object, instead of the Deferred object itself.

Members


componentName :string

Description

A name that identifies the component. Use the name to register a new component and get a component implementation with BackendComponentContainer.

Methods


cancelableOn( event_name, handler ) → {void}

Description

Attaches an event handler to an event.

Parameters
Name Type Description
event_name String

The event name that the handler will be attached to.

handler function

The event handler (function) that will be invoked when event_name is triggered. The event handler can accept one optional callback parameter. The event handler can return a Deferred object, which if resolved, executes the callback function. If the promise is rejected, the callback function does not execute.

Returns

cancelableOff( event_name, handler ) → {void}

Description

Detaches an event handler from an event.

Parameters
Name Type Description
event_name String

The event name that the handler will be detached from. This argument is required.

handler function

The event handler (function) that will be removed from the list of registered handlers. This argument is required.

Returns

cancelableDisable( event_name ) → {void}

Description

Disables all event handlers attached to an event.

Parameters
Name Type Description
event_name String

The name of the event for which event handlers will be disabled.

Returns

cancelableEnable( event_name ) → {Void}

Description

Re-enables all event handlers attached to an event.

Parameters
Name Type Description
event_name String

The name of the event for which event handlers will be re-enabled.

Returns

cancelableTrigger( event_name, ...args ) → {Deferred}

Description

Triggers an event with one or more arguments. If any of the event handlers associated with the event are rejected, callbacks will not be executed.

Parameters
Name Type Attributes Description
event_name String

The name of the event to trigger.

args params <repeatable>

Any arguments to be passed to all event handlers attached to the event.

Returns

Returns a Deferred object. Because event handlers are sometimes asynchronous, any callbacks in the event handlers will also be asynchronous.


cancelableTriggerUnsafe( event_name, ...args ) → {Deferred}

Description

Triggers an event with one or more unsanitized arguments. If any of the event handlers associated with the event are rejected, callbacks will not be executed.

Parameters
Name Type Attributes Description
event_name String

The name of the event to trigger.

args params <repeatable>

Any arguments to be passed to all event handlers attached to the event.

Returns

Returns a Deferred object. Because event handlers are sometimes asynchronous, any callbacks in the event handlers will also be asynchronous.


extend( componentDefinition ) → {BackendBaseComponent}

Description

Extends the current component and returns a child component.

Parameters
Name Type Description
componentDefinition Object

Any object that has properties and methods.


on( event_name, handler ) → {void}

Description

Attaches an event handler to an event name. Alias for BackendCancelableEvents#cancelableOn.

Parameters
Name Type Description
event_name string

The event name that the handler will be attached to.

handler function

The event handler (function) that will be invoked when event_name is triggered. The event handler can accept one optional callback parameter. The event handler can return a Deferred object, which if resolved, executes the callback function. If the promise is rejected, the callback function does not execute.

Returns

off( event_name, handler ) → {void}

Description

Detaches an event handler from an event name. Alias for BackendCancelableEvents#cancelableOff.

Parameters
Name Type Description
event_name string

The event name that the handler will be detached from. Optional.

handler function

The event handler (function) that will be removed from the list of registered handlers.

Returns