file.NameConflictResolution
Enum Description |
Holds the string values for supported conflict resolution types. Use the values in this enum to specify how to resolve conflicts when copying files. A conflict occurs when the target folder for a copy operation already contains a file with the same name as the file to copy. When a conflict occurs, you can specify how the conflict is resolved. For example, the This enum is used to set the value of the conflict resolution parameter in file.copy(options).
Note:
JavaScript does not include an enumeration type. The SuiteScript 2.0 documentation uses the term enumeration (or enum) to describe a plain JavaScript object with a flat, map-like structure. In this object, each key points to a read-only string value. |
Module |
|
Since |
2021.1 |
Values
Value |
Description |
---|---|
|
Fail with an error if a conflict occurs. |
|
Overwrite the existing file if a conflict occurs. Attributes and permissions of the overwritten file are preserved (meaning that the copied file has the same attributes and permissions as the file that was overwritten). |
|
Overwrite the existing file if a conflict occurs. Attributes and permissions are also overwritten. |
|
Add a numeric suffix to the name of the copied file if a conflict occurs. For example, if you are copying a file named file.txt and a conflict occurs, the name of the copied file is file (1).txt. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/file Module Script Samples.
// Add additional code
...
var fileObj = file.copy({
id: 123,
folder: 456,
conflictResolution: file.NameConflictResolution.OVERWRITE
});
...
// Add additional code