Salesforce

ClientFileRename (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

ClientFileRename (Magic xpa 4.x)

Renames a file.

Syntax:

ClientFileRename(origin,target)

Parameters:

origin – An Alpha string that represents the file specification of the file to be renamed.

target
– An alpha string that represents the new name.

Returns:

Success returns True. Failure returns False.

Example:

ClientFileRename('MAGIC.FILE','MAGIC.SAV') result: MAGIC.FILE is renamed MAGIC.SAV

Note:

  • In each parameter the string may include a path. If the path is omitted, Magic xpa assumes the current directory.

  • If the rename cannot be performed (e.g., the target file is on a different drive), the file will be copied to the target drive under the new name.

  • This is a client-side function that is only available for Rich Client tasks. To use the server-side version of this function in Rich Client tasks, see FileRename.

Exceptions:

This function is not supported in Web Client tasks.

Platform specific:

  • On iOS devices, only access to the temp folder is allowed. You can either use a relative path or use ClientOSEnvGet('temp') to get the folder.

  • On Android devices, the file system is case sensitive. The names of Magic xpa related files, such as images and local databases are automatically saved in lower case (even if the file is defined with upper case letters). This function will not convert the file name to lower case. Therefore, if you need to refer to the destination file from Magic xpa, you should use a lower case name in the function.

  • On Android devices, when executing this function on a file placed in external storage, if the application does not have permission to write in the external storage, the function returns False. To rename or delete a file in external storage, copy another file to the external storage so that the permission request will open. (Since version: 3.2b)

See also:

ClientFileCopy, ClientFileDelete, ClientFileExist, ClientFileSize

The Rich Client Samples project (REL19b)

Reference
Attachment 
Attachment