Skip to content
import VersionManagementService from "@arcgis/core/versionManagement/VersionManagementService.js";
Inheritance:
VersionManagementServiceAccessor
Since
ArcGIS Maps SDK for JavaScript 4.28

This class contains metadata about the version management service. The class can be constructed via a url to a version management service. The VersionManagementService grants users to plethora of functionality. The VersionManagementService contains methods for creating a new version, deleting a version, altering a version, changing a version on layers, start/stop reading, start/stop editing, reconciling, posting, and getting version infos. The Version Management Component offers another way to handle versioning using a UI.

See also
Example
// Initialize the VersionManagementService from a url
const versionManagementService = new VersionManagementService({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/TestService/VersionManagementServer"
});
// The layers that will be managed under the VersionManagementService
const layer1 = new FeatureLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/TestService/FeatureServer/12"
});
const layer2 = new FeatureLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/TestService/FeatureServer/13"
});
const layers = [layer1, layer2];
// The VersionManagementService must be loaded before any methods can be called
await versionManagementService.load();
// Change the version of two layers
versionManagementService.changeVersion(
layers,
{ name: "sde.DEFAULT", guid: "{13DEDC17-5867-4DBC-9855-0736C4C57162}"},
{ name: "admin.version", guid: "{422D1B63-D795-4478-A4B1-AD6109377074}"}
);

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.
Example
// Create a Version Management Service from a url
const versionManagementService = new VersionManagementService({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/TestService/VersionManagementServer"
});

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.
PropertyTypeClass
declaredClass
readonly inherited
loaded
readonly
loadError
readonly inherited
loadStatus
readonly inherited
"not-loaded" | "loading" | "failed" | "loaded"
loadWarnings
readonly inherited
any[]
url

capabilities

Property
Type
VersionManagementServiceCapabilitiesJSON | null | undefined

Describes the version management service's supported capabilities.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

defaultVersionIdentifier

Property
Type
VersionIdentifier

Contains the value for the default version's name and GUID.

loaded

readonly Property
Type
boolean

Indicates whether the instance has loaded. When true, the properties of the object can be accessed.

Default value
false

loadError

readonlyinherited Property
Type
EsriError | null | undefined
Inherited from: LoadableMixin

The Error object returned if an error occurred while loading.

loadStatus

readonlyinherited Property
Type
"not-loaded" | "loading" | "failed" | "loaded"
Inherited from: LoadableMixin

Represents the status of a load() operation.

ValueDescription
not-loadedThe object's resources have not loaded.
loadingThe object's resources are currently loading.
loadedThe object's resources have loaded without errors.
failedThe object's resources failed to load. See loadError for more details.
Default value
"not-loaded"

loadWarnings

readonlyinherited Property
Type
any[]
Inherited from: LoadableMixin

A list of warnings which occurred while loading.

name

Property
Type
string

The name of the version management service.

url

Property
Type
string

The absolute URL of the REST endpoint for the version management service. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online.

Methods

MethodSignatureClass
fromJSON
inherited static
fromJSON(json: any): any
alterVersion(versionIdentifier: VersionIdentifier, props: AlterVersionParametersProperties): Promise<boolean>
cancelLoad
inherited
cancelLoad(): this
canRedo(versionIdentifier: VersionIdentifier): boolean
canUndo(versionIdentifier: VersionIdentifier): boolean
changeVersion(input: WebMap | ReadonlyCollection<Layer> | Layer[] | Network, fromVersion: Date | VersionIdentifier, toVersion: Date | VersionIdentifier): Promise<boolean>
changeVersionWithResult(input: WebMap | Collection<VersionAdapter> | VersionAdapter[], fromVersion: Date | VersionIdentifier, toVersion: Date | VersionIdentifier): Promise<Map<VersionAdapter, ServiceResult>>
createVersion(props: CreateVersionParametersProperties): Promise<VersionInfoExtendedJSON>
deleteVersion(versionIdentifier: VersionIdentifier): Promise<boolean>
getLockType(versionIdentifier: VersionIdentifier): LockType
getVersionIdentifierFromGuid(guid: string): Promise<VersionIdentifier | null | undefined>
getVersionIdentifierFromName(name: string): Promise<VersionIdentifier | null | undefined>
getVersionInfoExtended(versionIdentifier: VersionIdentifier): Promise<VersionInfoExtendedJSON | null | undefined>
getVersionInfos(props?: GetVersionInfosParametersProperties): Promise<VersionInfoJSON[]>
isFulfilled
inherited
isFulfilled(): boolean
isRejected
inherited
isRejected(): boolean
isResolved
inherited
isResolved(): boolean
load(options?: AbortOptions | null | undefined): Promise<this>
post(versionIdentifier: VersionIdentifier): Promise<PostResult>
reconcile(versionIdentifier: VersionIdentifier, props?: ReconcileParametersProperties): Promise<ReconcileResult>
redo(versionIdentifier: VersionIdentifier): void
startEditing(versionIdentifier: VersionIdentifier): Promise<boolean>
startEditingWithResult(versionIdentifier: VersionIdentifier): Promise<ServiceResult>
startReading(versionIdentifier: VersionIdentifier): Promise<boolean>
startReadingWithResult(versionIdentifier: VersionIdentifier): Promise<ServiceResult>
stopEditing(versionIdentifier: VersionIdentifier, saveEdits: boolean): Promise<boolean>
stopEditingWithResult(versionIdentifier: VersionIdentifier, saveEdits: boolean): Promise<ServiceResult>
stopReading(versionIdentifier: VersionIdentifier): Promise<boolean>
stopReadingWithResult(versionIdentifier: VersionIdentifier): Promise<ServiceResult>
toJSON
inherited
toJSON(): any
undo(versionIdentifier: VersionIdentifier): void
when
inherited
when<TResult1 = this, TResult2 = never>(onFulfilled?: OnFulfilledCallback<this, TResult1> | null | undefined, onRejected?: OnRejectedCallback<TResult2> | null | undefined): Promise<TResult1 | TResult2>

fromJSON

inheritedstatic Method
Signature
fromJSON (json: any): any
Inherited from: JSONSupportMixin

Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameters
ParameterTypeDescriptionRequired
json
any

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns
any

Returns a new instance of this class.

alterVersion

Method
Signature
alterVersion (versionIdentifier: VersionIdentifier, props: AlterVersionParametersProperties): Promise<boolean>

The alter operation allows you to change the geodatabase version's name, description, owner, and access permissions.

License

This method requires the feature service and version management service to be published with ArcGIS Enterprise version 11.2 or higher. Organization members must be assigned a license for the ArcGIS Advanced Editing user type extension to use this method.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

props

Contains properties that will be altered.

Returns
Promise<boolean>

Returns true if version was altered successfully.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
const result = await versionManagementService.alterVersion(
{ name: "newVersion", guid: "{49C6AC87-CDA8-46D4-A79B-449105981209}" },
{
versionName: "versionName",
ownerName: "newOwner",
description: "newDescription",
access: "public"
}
);

cancelLoad

inherited Method
Signature
cancelLoad (): this
Inherited from: LoadableMixin

Cancels a load() operation if it is already in progress.

Returns
this

canRedo

Method
Signature
canRedo (versionIdentifier: VersionIdentifier): boolean

canRedo may be used to verify that a redo() operation is possible.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
boolean

Indicates whether a redo operation is possible.

canUndo

Method
Signature
canUndo (versionIdentifier: VersionIdentifier): boolean

canUndo may be used to verify that an undo() operation is possible.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
boolean

Indicates whether an undo operation is possible.

changeVersion

Method
Signature
changeVersion (input: WebMap | ReadonlyCollection<Layer> | Layer[] | Network, fromVersion: Date | VersionIdentifier, toVersion: Date | VersionIdentifier): Promise<boolean>

Method used to change a layer's version/moment or network's version/moment. Method allows changing version from named version to named version, or from default version to a moment and vice versa.

Parameters
ParameterTypeDescriptionRequired
input

Input used to change version on layers or network.

fromVersion

Current Version or Date moment.

toVersion

Incoming Version or Date.

Returns
Promise<boolean>

When resolved, response is true if change version was successful.

Example
// Initialize the VersionManagementService from a url
const versionManagementService = new VersionManagementService({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/TestService/VersionManagementServer"
});
const layer1 = new FeatureLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/12"
});
const layer2 = new FeatureLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/13"
});
const layers = [layer1, layer2];
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
await versionManagementService.changeVersion(
layers,
{ name: "sde.DEFAULT", guid: "{13DEDC17-5867-4DBC-9855-0736C4C57162}"},
{ name: "admin.version", guid: "{422D1B63-D795-4478-A4B1-AD6109377074}"}
);

changeVersionWithResult

Method
Signature
changeVersionWithResult (input: WebMap | Collection<VersionAdapter> | VersionAdapter[], fromVersion: Date | VersionIdentifier, toVersion: Date | VersionIdentifier): Promise<Map<VersionAdapter, ServiceResult>>
Since
ArcGIS Maps SDK for JavaScript 4.30

Method used to change a layer's version/moment or network's version/moment. Method allows changing version from named version to named version, or from default version to a moment and vice versa.

Parameters
ParameterTypeDescriptionRequired
input

Input used to change version on layers.

fromVersion

Current Version or Date moment.

toVersion

Incoming Version or Date.

Returns
Promise<Map<VersionAdapter, ServiceResult>>

When resolved, returns a map of version adapter to result.

Example
const [utils, VersionManagementService, FeatureLayer] = await $arcgis.import([
"@arcgis/core/versionManagement/versionAdapters/utils.js",
"@arcgis/core/versionManagement/VersionManagementService.js",
"@arcgis/core/layers/FeatureLayer.js"
]);
// Initialize the VersionManagementService from a url
const versionManagementService = new VersionManagementService({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/TestService/VersionManagementServer"
});
const layer1 = new FeatureLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/12"
});
const layer2 = new FeatureLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/13"
});
const adapters = utils.createVersionAdapters([layer1, layer2]);
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
await versionManagementService.changeVersionWithResult(
adapters,
{ name: "sde.DEFAULT", guid: "{13DEDC17-5867-4DBC-9855-0736C4C57162}"},
{ name: "admin.version", guid: "{422D1B63-D795-4478-A4B1-AD6109377074}"}
);

createVersion

Method
Signature
createVersion (props: CreateVersionParametersProperties): Promise<VersionInfoExtendedJSON>

Creates a new version given the following parameters.

Parameters
ParameterTypeDescriptionRequired
props

Contains properties required to create a version.

Returns
Promise<VersionInfoExtendedJSON>

Contains information about newly created version.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
// Create a version by passing the new version name, description, and access type set to 'public'.
const version = await versionManagementService.createVersion({
versionName: "versionName",
description: "description",
access: "public"
});

deleteVersion

Method
Signature
deleteVersion (versionIdentifier: VersionIdentifier): Promise<boolean>

Deletes a version given the following parameters.

License

This method requires the feature service and version management service to be published with ArcGIS Enterprise version 11.2 or higher. Organization members must be assigned a license for the ArcGIS Advanced Editing user type extension to use this method.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
Promise<boolean>

Specifies if the selected version was deleted.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
versionManagementService.deleteVersion({
name: "versionName",
guid: "{422D1B63-D795-4478-A4B1-AD6109377075}"
});

getLockType

Method
Signature
getLockType (versionIdentifier: VersionIdentifier): LockType

Returns the current client lock type on a given version.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
LockType

Specifies the lock type on the version. Returns either "edit", "none", or "read".

Example
versionManagementService.getLockType({ name: "newVersion", guid: "{49C6AC87-CDA8-46D4-A79B-449105981209}" });

getVersionIdentifierFromGuid

Method
Signature
getVersionIdentifierFromGuid (guid: string): Promise<VersionIdentifier | null | undefined>

This method will return the VersionIdentifier given the guid of the version.

Parameters
ParameterTypeDescriptionRequired
guid

GUID of version.

Returns
Promise<VersionIdentifier | null | undefined>

Returns VersionIdentifier.

getVersionIdentifierFromName

Method
Signature
getVersionIdentifierFromName (name: string): Promise<VersionIdentifier | null | undefined>

This method will return the VersionIdentifier given the name of the version.

Parameters
ParameterTypeDescriptionRequired
name

Name of version.

Returns
Promise<VersionIdentifier | null | undefined>

Returns VersionIdentifier.

getVersionInfoExtended

Method
Signature
getVersionInfoExtended (versionIdentifier: VersionIdentifier): Promise<VersionInfoExtendedJSON | null | undefined>

Method used to get extended information about a version.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
Promise<VersionInfoExtendedJSON | null | undefined>

Contains extended info about given version.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
const version = await versionManagementService.getVersionInfoExtended({
guid: "{422D1B63-D795-4478-A4B1-AD6109377075}",
name: "versionName"
});

getVersionInfos

Method
Signature
getVersionInfos (props?: GetVersionInfosParametersProperties): Promise<VersionInfoJSON[]>

Returns information about a version or versions. If no arguments are provided, this method will return all versions accessible to the currently logged-in user.

Parameters
ParameterTypeDescriptionRequired
props
Returns
Promise<VersionInfoJSON[]>

Contains info of versions.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
const versions = await versionManagementService.getVersionInfos({ ownerFilter: "publisher1", includeHidden: true });

isFulfilled

inherited Method
Signature
isFulfilled (): boolean
Inherited from: EsriPromiseMixin

isFulfilled() may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected). If it is fulfilled, true will be returned.

Returns
boolean

Indicates whether creating an instance of the class has been fulfilled (either resolved or rejected).

isRejected

inherited Method
Signature
isRejected (): boolean
Inherited from: EsriPromiseMixin

isRejected() may be used to verify if creating an instance of the class is rejected. If it is rejected, true will be returned.

Returns
boolean

Indicates whether creating an instance of the class has been rejected.

isResolved

inherited Method
Signature
isResolved (): boolean
Inherited from: EsriPromiseMixin

isResolved() may be used to verify if creating an instance of the class is resolved. If it is resolved, true will be returned.

Returns
boolean

Indicates whether creating an instance of the class has been resolved.

load

Method
Signature
load (options?: AbortOptions | null | undefined): Promise<this>

Triggers the loading of the version management service instance.

Fully loads the Version Management Service definition.

Parameters
ParameterTypeDescriptionRequired
options

Additional options.

Returns
Promise<this>

Resolves when the Feature Service is loaded.

post

Method
Signature
post (versionIdentifier: VersionIdentifier): Promise<PostResult>

The Post operation allows the client to post the changes in their version to the default version. A reconcile operation must be performed prior to post.

License

This method requires the feature service and version management service to be published with ArcGIS Enterprise version 11.2 or higher. Organization members must be assigned a license for the ArcGIS Advanced Editing user type extension to use this method.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
Promise<PostResult>

Returns the result of the post.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
const postResult = await versionManagementService.post({
guid: "{422D1B63-D795-4478-A4B1-AD6109377075}",
name: "versionName"
});

reconcile

Method
Signature
reconcile (versionIdentifier: VersionIdentifier, props?: ReconcileParametersProperties): Promise<ReconcileResult>

Use the reconcile operation to reconcile a branch version with the default version. The reconcile operation requires that you are the only user currently editing the version and remain so throughout the reconcile process until you save or post your edits. You must have full permissions to all the feature classes that have been modified in the version being edited. This operation detects differences between the branch version and the default version and flags these differences as conflicts.

License

This method requires the feature service and version management service to be published with ArcGIS Enterprise version 11.2 or higher. Organization members must be assigned a license for the ArcGIS Advanced Editing user type extension to use this method.

Changes to Reconcile

Starting with ArcGIS Server 12.0, calling reconcile will now save pending edits to the version as part of the operation. In addition, calling stopEditing will block post until another reconcile is performed.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

props

Properties used for a reconcile.

Returns
Promise<ReconcileResult>

Returns the result of the reconcile.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
const reconcileResult = await versionManagementService.reconcile({
guid: "{422D1B63-D795-4478-A4B1-AD6109377075}",
name: "versionName"
},
{
abortIfConflicts: true,
conflictDetection: "by-object",
withPost: false
});

redo

Method
Signature
redo (versionIdentifier: VersionIdentifier): void

This method redos the last edit made while in an edit session.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
void

startEditing

Method
Signature
startEditing (versionIdentifier: VersionIdentifier): Promise<boolean>

Using the specified session ID an exclusive lock is obtained for the session on the version. The exclusive lock can only be obtained if no other shared or exclusive locks are present and the session currently holds a shared lock. The exclusive lock ensures read and write isolation for the session holding the lock. The exclusive lock is downgraded to a shared lock by using the stopEditing operation.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
Promise<boolean>

Specifies if start editing was successful.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
versionManagementService.startEditing({ name: "newVersion", guid: "{49C6AC87-CDA8-46D4-A79B-449105981209}" });

startEditingWithResult

Method
Signature
startEditingWithResult (versionIdentifier: VersionIdentifier): Promise<ServiceResult>
Since
ArcGIS Maps SDK for JavaScript 4.30

Using the specified session ID an exclusive lock is obtained for the session on the version. The exclusive lock can only be obtained if no other shared or exclusive locks are present and the session currently holds a shared lock. The exclusive lock ensures read and write isolation for the session holding the lock. The exclusive lock is downgraded to a shared lock by using the stopEditing operation.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
Promise<ServiceResult>

Specifies if start editing was successful.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
versionManagementService.startEditingWithResult({ name: "newVersion", guid: "{49C6AC87-CDA8-46D4-A79B-449105981209}" });

startReading

Method
Signature
startReading (versionIdentifier: VersionIdentifier): Promise<boolean>

Using the specified client generated session ID, a shared lock is obtained for the session if the version is not already being edited by another user/session.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
Promise<boolean>

Specifies if start reading was successful.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
versionManagementService.startReading({ name: "newVersion", guid: "{49C6AC87-CDA8-46D4-A79B-449105981209}" });

startReadingWithResult

Method
Signature
startReadingWithResult (versionIdentifier: VersionIdentifier): Promise<ServiceResult>
Since
ArcGIS Maps SDK for JavaScript 4.30

Using the specified client generated session ID, a shared lock is obtained for the session if the version is not already being edited by another user/session.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
Promise<ServiceResult>

Specifies if start reading was successful.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
versionManagementService.startReadingWithResult({ name: "newVersion", guid: "{49C6AC87-CDA8-46D4-A79B-449105981209}" });

stopEditing

Method
Signature
stopEditing (versionIdentifier: VersionIdentifier, saveEdits: boolean): Promise<boolean>

Using the specified session id, the exclusive lock for the version is downgraded to a shared lock. The saveEdits parameter specifies if the edits for the session should be saved (true) or discarded (false).

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

saveEdits

If set to true edits will be saved, if false edits will not be saved.

Returns
Promise<boolean>

Specifies if stop editing was successful.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
versionManagementService.stopEditing(
{ name: "newVersion", guid: "{49C6AC87-CDA8-46D4-A79B-449105981209}" },
true,
);

stopEditingWithResult

Method
Signature
stopEditingWithResult (versionIdentifier: VersionIdentifier, saveEdits: boolean): Promise<ServiceResult>
Since
ArcGIS Maps SDK for JavaScript 4.30

Using the specified session id, the exclusive lock for the version is downgraded to a shared lock. The saveEdits parameter specifies if the edits for the session should be saved (true) or discarded (false).

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

saveEdits

If set to true edits will be saved, if false edits will not be saved.

Returns
Promise<ServiceResult>

Specifies if stop editing was successful.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
versionManagementService.stopEditingWithResult(
{ name: "newVersion", guid: "{49C6AC87-CDA8-46D4-A79B-449105981209}" },
true,
);

stopReading

Method
Signature
stopReading (versionIdentifier: VersionIdentifier): Promise<boolean>

The shared lock is released on the version.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
Promise<boolean>

Specifies if stop reading was successful.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
versionManagementService.stopReading({ name: "newVersion", guid: "{49C6AC87-CDA8-46D4-A79B-449105981209}" });

stopReadingWithResult

Method
Signature
stopReadingWithResult (versionIdentifier: VersionIdentifier): Promise<ServiceResult>
Since
ArcGIS Maps SDK for JavaScript 4.30

The shared lock is released on the version.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
Promise<ServiceResult>

Specifies if stop reading was successful.

Example
// Make sure the VersionManagementService is loaded
await versionManagementService.load();
versionManagementService.stopReadingWithResult({ name: "newVersion", guid: "{49C6AC87-CDA8-46D4-A79B-449105981209}" });

toJSON

inherited Method
Signature
toJSON (): any
Inherited from: JSONSupportMixin

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.

Returns
any

The ArcGIS portal JSON representation of an instance of this class.

undo

Method
Signature
undo (versionIdentifier: VersionIdentifier): void

This method undos the last edit made while in an edit session.

Parameters
ParameterTypeDescriptionRequired
versionIdentifier

Identifier for a version.

Returns
void

when

inherited Method
Signature
when <TResult1 = this, TResult2 = never>(onFulfilled?: OnFulfilledCallback<this, TResult1> | null | undefined, onRejected?: OnRejectedCallback<TResult2> | null | undefined): Promise<TResult1 | TResult2>
Type parameters
<TResult1 = this, TResult2 = never>
Inherited from: EsriPromiseMixin

when() may be leveraged once an instance of the class is created. This method takes two input parameters: an onFulfilled function and an onRejected function. The onFulfilled executes when the instance of the class loads. The onRejected executes if the instance of the class fails to load.

Parameters
ParameterTypeDescriptionRequired
onFulfilled

The function to call when the promise resolves.

onRejected

The function to execute when the promise fails.

Returns
Promise<TResult1 | TResult2>

Returns a new promise for the result of onFulfilled that may be used to chain additional functions.

Example
// Although this example uses MapView, any class instance that is a promise may use when() in the same way
let view = new MapView();
view.when(function(){
// This function will execute once the promise is resolved
}, function(error){
// This function will execute if the promise is rejected due to an error
});