Folders are created in the context of a parent, that is, folders are always created within a container or a parent folder. In addition, some folder types support creation and others do not. You can only create a new folder if the folder's type supports creation. The following folder types support creation:
After a new folder has been created, the folder is empty, that is, it has no scalars set within it. Note that your application must set the scalars for the new folder. Using the SmsDescribeFolder function, your application can retrieve the list of scalars for a folder. Using the SmsSetScalar function, your application can set the value for each scalar in the new folder. For some folders, such as the job folders F_INSTALLJOB, F_SRVINSTALL, and F_REMPKGJOB, some scalars are required and others are optional or dependent on the settings of other scalars.
A new folder also does not contain any subfolders. You can use the SmsCreateFolder function to add subfolders to the new folder.
In addition, a new folder created by SmsCreateFolder is not linked to its parent folder. Your application must use the SmsLinkFolder function to link a new folder to its parent. Linking associates the new folder to its parent within your application's memory—the folder is not written to the site database.
To add the new folder to the site database, your application must use the SmsCommitFolder function to write the folder to the database.
Some types of folders require their parent folder to be committed. These folders are not written to the site database until their parent folder is committed. If a folder requires its parent to be committed, the SmsCommitFolder function returns SMS_PARENT_NEEDS_COMMIT. Currently, when folders of the following types are committed, their parent folders also need to be committed:
Note that when your application creates a folder the usage count for the new folder is set to 1. To deallocate the memory for the new folder, your application must use SmsCloseFolder to close the folder.