I need to be able to move activities from one resource to another by dragging. I have set the AllowDragging Property to "AcrossResources", however I am not able to move an activity from one resource to another.
I looked up the help document and here is what I found:
However note that the underlying schedule data connector may impose limitations on whether an activity's resource calendar or resource can be changed or not, in which case regardless of what this property is set to, the underlying schedule data connector restriction will be effective.
However, it does not state what the limitations set by the custom objects are. Is there something we should take care of in the custom objects or in the proeprty mapping to allow this to happen.
Please Suggest.
Thank You,
Hariharan
There is no event raised during the drag that you can use so the best that you can do at the moment is to handle the ActivityChanging event and perform your validation there. The Activity of the event arguments is the activity being changed and its properties will contain the updated values which in the case of editing an activity such that it is moved to another calendar would mean the OwningCalendar and OwningCalendarId would have been changed. You can compare the values of those properties to the properties on the OriginalActivityData that is also provided in the event args. If that fails your validation you can set the e.Cancel to true.
hmmm.. I need to be able to cancel an appointment being dragged across calendar based on certain attributes of the destination calendar. How best can i do it.
For example, when i am dragging appointment 1 from calendar 1 to calendar 2, i need to know that the target calendar is calendar 2 and if certains conditions fail, i should stop the user from dropping it in calendar 2.
Please Suggest. This is important for my business process.
The dragging event is invoked before the drag operation has started so it is not known at that point what the target calendar/timeslot will be.
Is there a way for me to get target calendar Id in the activity Dragging Event ?
Can you give me more details about what you are trying to accomplish? If you are just trying to validate on the drop then you can handle the ActivityChanging event and check the properties of the Activity vs the properties of the OriginalActivityData to see what has changed and cancel that if necessary. That will be invoked at the point of the drop. If you want to only allow the activity to be dragged within that calendar then you can or to another calendar within the same resource then you can set the AllowDragging of the AppointmentSettings accordingly.