Namespace: Document

Appearition.Part.Document

Use the functions under this module to create, change and remove Part Documents on the Appearition platform

Methods

Appearition.Part.Document.CreatePartDocument (request, requestOptions)Appearition.Part.Document.PartDocItemViewModel static

Will create a new record in the database to hold the Part document information. Once this returns successfully, you can invoke the UploadPartDocument method to push the new file up to the server. You will need to pick up the new PartDocumentId from the return object and pass it to the UploadPartDocument. Will return an Appearition.Part.Document.PartDocItemViewModel object

Name Type Description
request Appearition.Part.Document.PartDocItemViewModel

Contains the details of the Part document

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Returns:
Type Description
Appearition.Part.Document.PartDocItemViewModel This is returned as part of the success callback function in the requestOptions param

Appearition.Part.Document.DeletePartDocument (request, requestOptions) static

Will delete an existing Part document. Nothing will be returned unless an error occurs.

Name Type Description
request Appearition.Part.Document.PartDocItemViewModel

Contains the details of the Part

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Appearition.Part.Document.PartDocuments (partId, requestOptions)Appearition.Part.Document.PartDocViewModel static

This method will return all documents linked to the specified Part record. It will return a collection of Appearition.Part.Document.PartDocViewModel

Name Type Description
partId number

uniquely identifies the Part for which the documents are being returned

requestOptions Appearition.RequestOptions

configure callbacks

Returns:
Type Description
Appearition.Part.Document.PartDocViewModel This is returned as part of the success callback function in the requestOptions param

Appearition.Part.Document.UpdatePartDocument (request, requestOptions)Appearition.Part.Document.PartDocItemViewModel static

Will setup a new version of the Part document. Once this returns successfully, you can invoke the UploadPartDocument method to push the new file up to the server. You will need to pick up the new PartDocumentId from the return object and pass it to the UploadPartDocument. Will return an Appearition.Part.Document.PartDocItemViewModel object

Name Type Description
request Appearition.Part.Document.PartDocItemViewModel

Contains the details of the Part

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Returns:
Type Description
Appearition.Part.Document.PartDocItemViewModel This is returned as part of the success callback function in the requestOptions param

Appearition.Part.Document.UploadPartDocument (partDocumentId, fileName, fileContent, requestOptions) static

Once the CreatePartDocument or UpdatePartDocument methods succeed, invoke this method to upload the file to the server. This will not return anything unless a failure occurs.

Name Type Description
partDocumentId number

The unique identifier of the Part Document which returned by the CreatePartDocument or UpdatePartDocument methods

fileName number

The name of the file being uploaded

fileContent string

The file contents that need to be submitted to the server

requestOptions Appearition.RequestOptions

Contains the various callback methods for this request

Type Definitions

Appearition.Part.Document.PartDocItemViewModel

This data structure holds the details of a specific Part document

Properties:
Name Type Description
PartDocumentId number

The unique identifier of the Part Document. This is a system generated value

PartId number

The unique identifier of the Part this document is linked to

PartName string

The name of the part

DocumentTitle string

The title of the document. This will differ to FileName

Description string

The description of the document

FileName string

The description of the document

DocumentVersion number

The version of the document. You upload a new file to an existing PartDocument and the version number will increment

ModifiedUtcDateDisplay string

The date/time the document was changed. (Format "d/MM/yy HH:mm"). Note, whilst the field name suggest UTC, the server will attempt to convert it to your local timezone if its known. If not the UTC date is simply returned

Appearition.Part.Document.PartDocViewModel

This data structure holds the details of a specific Part and a collection of all its documents

Properties:
Name Type Description
Part Appearition.Part.PartSummaryViewModel

The summary details of the specific Part

Docs Array.<Appearition.Part.Document.PartDocItemViewModel>

The collection of documents linked to the Part

Doc Appearition.Part.Document.PartDocItemViewModel

Is an empty data structure that can be used to setup a new doc for saving to the server