Accept Ownership Delegation via SDK
I need to create a simple tool that should be able to delegate tasks and allow user to accept them through it.
I know that there is a method IProgram.delegateOwnership for delegating a task.
Is there a way to accept pending ownership via SDK and remove the task from Pending Request in the user Home Page?
Yes, you can update the owner of the activity via the SDK. But you might want to look into avoiding having to go through the process of delegating altogether. In 9.3.3 you no longer have to delegate in order to assign an activity to someone else. There is also a hotfix for 9.3.1 that allows the same behavior.
I want to reproduce the Delegation behavior as done in the Web Application. When activity is in progress, its owner cannot be modified directly via SDK.
We have 9.3.2 and we are going to upgrade it to 9.3.3. Could you please send me the SDK method that allow to assign an activity to someone else? Just to know if it can be applied to our process.
You might be stuck once it is started if you want to delegate. In 9.3.3 the owner field become writeable. Here is using the delegate method.
// Delegate will add the new record in addition to the
// old record on the team tab
// too bad substituteResource doesn’t work for the ownerÂ
// program.substituteResource(ido, user, false);
// assign from pool doesn’t work for the owner either
// program.assignUsersFromPool(new IUser[] {user}, (IUserGroup)ido,false);
// will have to delegate then
//——-
program.delegateOwnership(user, false);
In summary, in 9.3.3 or with hotfix, to delegate I can use for example:
— program.delegateOwnership(userToDelegate, applieToChildrenBoolean)
and then to accept
— program.setValue(ProgramConstants.Att_Owner, userToDelegate)
Is it correct?
Now in 9.3.2 it throws exception due to the fact that attribute owner is Read Only.