Class ListItem

Represents an item or row in a list.

Hierarchy

Index

Methods

Methods

public breakRoleInheritance(copyRoleAssignments: boolean, clearSubscopes: boolean)

Parameters

  • copyRoleAssignments: boolean
  • clearSubscopes: boolean

public customFromJson(initValue: any): boolean

Parameters

  • initValue: any

Returns

boolean

public deleteObject()

Deletes the list item

public fromJson(initValue: any)

Parameters

  • initValue: any

public getUserEffectivePermissions(userName: string): BasePermissions

Gets effective permissions for the specified user.

Parameters

  • userName: string

Returns

BasePermissions

public getWOPIFrameUrl(action: SPWOPIFrameAction): StringResult

Parameters

Returns

StringResult

public get_attachmentFiles(): AttachmentCollection

Gets collection of objects that represent attachments for the list item.

Returns

AttachmentCollection

public get_contentType(): ContentType

Gets the content type of the item.

Returns

ContentType

public get_context(): ClientRuntimeContext

Returns

ClientRuntimeContext

public get_displayName(): string

Gets a value that specifies the display name of the list item. This property is not available by default when you return list items. Trying to call this method returns a PropertyOrFieldNotInitializedException if you try to access one of these properties. To access this property, use the Include method as part of the query string.

Returns

string

public get_effectiveBasePermissions(): BasePermissions

Gets a value that specifies the effective permissions on the list item that are assigned to the current user. This property is not available by default when you return list items. Trying to call this method returns a PropertyOrFieldNotInitializedException if you try to access one of these properties. To access this property, use the Include method as part of the query string.

Returns

BasePermissions

public get_effectiveBasePermissionsForUI(): BasePermissions

Gets the effective base permissions for the current user, as they should be displayed in UI. This will only differ from EffectiveBasePermissions if ReadOnlyUI is set to true on the item's parent list, and in all cases will be a subset of EffectiveBasePermissions. To put it another way, EffectiveBasePermissionsForUI will always be as or more restrictive than EffectiveBasePermissions. This property is not available by default when you return list items. Trying to call this method returns a PropertyOrFieldNotInitializedException if you try to access one of these properties. To access this property, use the Include method as part of the query string.

Returns

BasePermissions

public get_fieldValues(): any

Returns

any

public get_fieldValuesAsHtml(): FieldStringValues

Returns

FieldStringValues

public get_fieldValuesAsText(): FieldStringValues

Returns

FieldStringValues

public get_fieldValuesForEdit(): FieldStringValues

Returns

FieldStringValues

public get_file(): File

Gets the file that is represented by the item from a document library. Only for document libraries.

Returns

File

public get_fileSystemObjectType(): FileSystemObjectType

Gets or sets the file system object type for the item (file, folder or invalid).

Returns

FileSystemObjectType

public get_firstUniqueAncestorSecurableObject(): SecurableObject

Returns

SecurableObject

public get_folder(): Folder

Gets the parent folder for the list item

Returns

Folder

public get_hasUniqueRoleAssignments(): boolean

Returns

boolean

public get_id(): number

Gets id of the item

Returns

number

public get_item(fieldInternalName: string): any

Gets the specified field value for the list item. Field value is returned as string, but it can be casted to a specific field value type, e.g. SP.LookupFieldValue, etc.

Parameters

  • fieldInternalName: string

Returns

any

public get_objectVersion(): string

Returns

string

public get_parentList(): List

Get the list in which the item resides.

Returns

List

public get_path(): ObjectPath

Returns

ObjectPath

public get_roleAssignments(): RoleAssignmentCollection

Returns

RoleAssignmentCollection

public get_serverObjectIsNull(): boolean

Returns

boolean

public get_typedObject(): ClientObject

Returns

ClientObject

public isObjectPropertyInstantiated(propertyName: string): boolean

Parameters

  • propertyName: string

Returns

boolean

public isPropertyAvailable(propertyName: string): boolean

Parameters

  • propertyName: string

Returns

boolean

public parseAndSetFieldValue(fieldInternalName: string, value: string)

Sets the value of the field for the list item based on an implementation specific transformation of the value.

Parameters

  • fieldInternalName: string
  • value: string

public recycle(): GuidResult

Moves the list item to the Recycle Bin and returns the identifier of the new Recycle Bin item.

Returns

GuidResult

public refreshLoad()

public resetRoleInheritance()

public retrieve()

public retrieve(propertyNames: Array<string>)

Parameters

  • propertyNames: Array<string>

public set_item(fieldInternalName: string, value: any)

Sets the specified field value for the list item. Consider using parseAndSetFieldValue instead.

Parameters

  • fieldInternalName: string
  • value: any

public set_objectVersion(value: string)

Parameters

  • value: string

public update()

Commits changed properties of the list item. The actual update is performed during context.executeQueryAsync method call.

public validateUpdateListItem(formValues: ListItemFormUpdateValue[], bNewDocumentUpdate: boolean): ListItemFormUpdateValue[]

Validates form values specified for the list item. Errors are returned through hasException and errorMessage properties of the ListItemFormUpdateValue objects

Parameters

Returns

ListItemFormUpdateValue[]