createFolderByPath
createFolderByPath(options)
Method Description | This function allows you to create a new file in SharePoint. |
Returns | DirectoryItem |
Supported Script Types | SuiteScript 2.1 |
Limitations | None |
Module | b4cd-file-api-lib.js |
Since | FileSync 0.5.2 |
Parameters
Note: The options
parameter is a JavaScript object.
Property | Type | Required | Description | Since |
---|---|---|---|---|
| string | required | The name of the new Folder which we are creating. | 0.5.2 |
| string | required | The path of the parent-folder for which the new folder will be created under. This value is generally retrieved by making a call to the getRecordFolderContents or the getFolderContentsById method. | 0.5.2 |
| integer | required | Internal ID of the FileSync Record Type Configuration record (customrecord_b4cd_record_type_config). | 0.5.2 |
Returns Directory Item
Property | Type | Description | Since |
---|---|---|---|
| string | The file or folder name | 0.6.0 |
| string | The unique ID of the file or folder as assigned by the file hosting service. | 0.6.0 |
| string | Possible Values: "file", "folder" | 0.6.0 |
| integer | File size in bytes. | 0.6.0 |
| string | The URI used to access the file or folder via the API. | 0.6.0 |
| string | The relative file or folder path on the file hosting service starting from the base directory. | 0.6.0 |
| string | The user-navigable URI for the folder or file on the file hosting platform. This can be used to construct hyperlinks for users to reach the file or folder externally. | 0.6.0 |
| string | file contents as encoded Base64 content | 0.6.0 |
DirectoryItem.parentFolderName | string | If options.includeSubfolders is true this value will return the parent folder name of the directory item. | 0.6.0 |
DirectoryItem.parentFolderUniqueId | string | If options.includeSubfolders is true this value will return the parent folder unique ID of the directory item. | 0.6.0 |
Errors
Error Code | Details |
---|---|
| A required argument is missing or undefined. |
Example Usage
var params = {
folderName: "attachments",
parentFolderPath: "/sites/FilesConnectorSite/Shared Documents/Vendor Bill/20703",
recordTypeConfigId: 35
}
fileapi.createFolderByPath(params)