SaveAsDraft method: Tree class
Syntax
SaveAsDraft(SetID, UserKeyValue, TreeName, EffDt, Branch`Name)
Description
The SaveAsDraft method writes any changes to the tree executing the method to the new tree specified with the parameters. However, it does not perform audits. Trees that are saved in this way are marked as "draft" and will not be valid (that is, cannot be used with other PeopleTools) until the tree audit is passed during Save, SaveAs, or the Tree Audits Application Engine Tree Utility program..
The tree specified with the parameters must be a new tree. You receive an error if the tree already exists. The new tree must have at least one different key field from the original tree.
The SaveAsDraft method automatically closes the tree that is associated with the tree object executing the method, and associates that tree object with the new tree. Any changes made to the original tree since the last time the tree was saved are discarded.
See SaveAs for more details.
Note:
If you’re calling the Tree API from an Application Engine program, the data won’t actually be committed to the database until the Application Engine program performs a Commit.
Parameters
| Parameter | Description |
|---|---|
|
SetID |
Specify the table indirection key for the tree. This parameter takes a string value. If the tree structure the tree is based on has its IndirectionMethod specified as "S", you must specify a SetID. If the tree structure doesn’t have its IndirectionMethod specified as "S", you must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter. |
|
UserKeyValue |
Specify the User Key Value for the tree. This parameter takes a string value. If the tree structure the tree is based on has its IndirectionMethod specified as "U" or "B", you must specify a User Key Value. If the tree structure doesn’t have its IndirectionMethod specified as "U" or "B", you must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter. |
|
TreeName |
Specify the name for this tree. This parameter takes a string value. |
|
EffDt |
Specify the effective date for this tree. This parameter takes a string value. |
|
BranchName |
This parameter is required, but it is unused in this release. You must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter. |
Returns
This method returns an integer: 0 if saved successfully, a number greater than 0 otherwise.
Example
&MYTREE. SaveAsDraft("","","PERSONAL_EDIT2", "05-05-1997", "");