Assigns an Approval Plan to one more users. An exception will be raised if either the Plan ID/Name cannot be found, or if one of the users does not exist, or if the caller does not have the authority to do this. Returns a zero (0) if the assignment was successful.
Note that the first parameter can be either the unique ID of the Approval Plan, or it can be the Name as it appears on the Plan Modification screens. The Unique ID changes every time the administrator modifies the Plan, because the record is deleted and re-added, and so it is often convenient to assign Plans based on their name.
Also note that Plans for Time, Expense, and Mileage can all be used with this function. But since each of these types of Plans may have the same name, if you specify an ambiguous name they will be 'resolved' in the order of Time, then Expense, then Mileage. If other words, if you have both Time and Expense Plans named 'My Plan', and call this function as AssignApprovalPlan('My Plan', ['user1', 'user2']), then only the Time Plan will get assigned to the users, not the Expense Plan.
| Name | Type | Description |
|---|---|---|
| skey | string | |
| id | string |
The ID of the approval plan to assign. |
| uids | array of string |
A list of user IDs to assign the approval plan to. |
The AssignApprovalPlan method returns zero (an integer).
© Copyright 1997-2007 Journyx