Difference between revisions of "TeamMember new"
Nguyenduyan (talk | contribs) (→TeamMember_new) (Tag: visualeditor) |
Nguyenduyan (talk | contribs) (→Example) (Tag: visualeditor) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 20: | Line 20: | ||
== Return type == | == Return type == | ||
− | array | + | |
+ | An <nowiki>''array''</nowiki>, it is a TeamMember object which contains the following items | ||
+ | {| class="tableintopic" style="border: 1px solid rgb(1, 1, 1); border-collapse: collapse;" width="875" cellspacing="0" cellpadding="2" border="1" | ||
+ | |- valign="top" align="left" | ||
+ | | style="border: 1px solid rgb(1, 1, 1);" width="292" bgcolor="#c0c0c0" | | ||
+ | '''Index''' | ||
+ | |||
+ | | style="border: 1px solid rgb(1, 1, 1);" width="116" bgcolor="#c0c0c0" | | ||
+ | '''Data type''' | ||
+ | |||
+ | | style="border: 1px solid rgb(1, 1, 1);" width="467" bgcolor="#c0c0c0" | | ||
+ | '''Value''' | ||
+ | |- | ||
+ | |OBJECT_TYPE | ||
+ | |number | ||
+ | |Object type (Default value: 34) | ||
+ | |- | ||
+ | |TEAM_MEMBER_ROLE_ID | ||
+ | |number | ||
+ | |Role Id | ||
+ | |- | ||
+ | |TEAM_MEMBER_RESOURCE_ID | ||
+ | |number | ||
+ | |Team member Resource id (User Resource id) | ||
+ | |- | ||
+ | |TEAM_MEMBER_MAN_HOURS | ||
+ | |number | ||
+ | |Man hours | ||
+ | |||
+ | |} | ||
== Example == | == Example == | ||
Line 32: | Line 61: | ||
number teamMemberRId = 15567438; | number teamMemberRId = 15567438; | ||
number Manhours = 30; | number Manhours = 30; | ||
− | array teamMember = TeamMember_new(roleId,teamMemberRId, Manhours); | + | array teamMember = TeamMember_new(roleId,teamMemberRId, Manhours);//{34,2,15567438,30} |
Team_addTeamMember(team, teamMember); | Team_addTeamMember(team, teamMember); | ||
Team_save(team); | Team_save(team); | ||
</source> | </source> | ||
+ | |||
+ | The team before add member | ||
+ | [[File:Team3.png]] | ||
+ | |||
+ | |||
+ | The team after add member | ||
+ | [[File:Team5.png]] |
Latest revision as of 03:47, 23 June 2017
TeamMember_new
Create a new team member (On GUI, Team is under Team tab of resource)
Need Team_addTeamMember to add the new TeamMember to a Team
Syntax
TeamMember_new(roleId, teamMemberRId, Manhours);
Arguments
number roleId: Id of Role (on GUI, you can find role at Administration/HR/Roles)
number teamMemberRId: UserRId
number Manhours: unit is minute
Return type
An ''array'', it is a TeamMember object which contains the following items
Index |
Data type |
Value |
OBJECT_TYPE | number | Object type (Default value: 34) |
TEAM_MEMBER_ROLE_ID | number | Role Id |
TEAM_MEMBER_RESOURCE_ID | number | Team member Resource id (User Resource id) |
TEAM_MEMBER_MAN_HOURS | number | Man hours |
Example
number projectRId = 15562383;
number teamTypeId = 1;
number groupRId = 15567436;
array team = Team_getTeamByResourceId (projectRId, teamTypeId, groupRId);
number roleId = 2;
number teamMemberRId = 15567438;
number Manhours = 30;
array teamMember = TeamMember_new(roleId,teamMemberRId, Manhours);//{34,2,15567438,30}
Team_addTeamMember(team, teamMember);
Team_save(team);