Skip to main content

Hi everybody,

 

I have an issue with Out Of Office API. 

 

This is my code

 

                    WorklistCriteria criteria = new WorklistCriteria();                                       Destinations destination = new Destinations();                    destination.Add(new Destination(("K2:" + AssignedTo), DestinationType.User)); //e.g. K2:DOMAINUsername                                        WorkType worktype = new WorkType(AssignedTo, criteria, destination);                    //now set up the worklist Out of Office (OOF) delegation                    WorklistShare worklistshare = new WorklistShare();                    worklistshare.ShareType = ShareType.OOF;                    //Set time interval for the Sharing. These dates may be used to only share work for a specific period                     worklistshare.StartDate = from;                    worklistshare.EndDate = to;                     //add the worktype                    worklistshare.WorkTypes.Add(worktype);                    //Share the worklist                     ktwoWorkflowClientServer.ShareWorkList(worklistshare);                    //Share the worklist for a managed user                    //ktwoWorkflowClientServer.ShareWorkList(originator, worklistshare);                    //When the current user's status is set to OOF the worklist shares defined above will take effect                    ktwoWorkflowClientServer.SetUserStatus(UserStatuses.OOF);                    return true;

The problem is about the EndDate.

 

It seems that althought the OOF is expired,in the workspace the user is OOF after the EndDate.

 

Anybody know if it is a issue or I have done something wrong?

 

Many thanks!

 

Regards

Hello ,

 

I would say dont set OOB end date . any way you are calling API . Get the end date from user's and run the workflow and when OOF end date reached based on that you can write your logic in workflow and do the rest over there.

 

 


Reply