I can easily add a resource to a NEW Activity through code.
Is there a way to add a resource when using AppointmentAdd.aspx?
How do I ADD a resource to an existing Activity?
How do I MODIFY a resource from an existing Activity?
How do I DELETE a resource from an existing Activity?
thanks,mikez
There is a one-to-one relationship between an Activity and the Resource which owns it. Therefore when you think you can easily add a resource to a new Activity, it really is that you can easily create an Activity having a resource (through the Activity's ResourceKey property, no doubt).
There is no way when using the Add/Edit Appointment dialog UI to attach additional Resources to the Activity. A newly added Activity will be owned by the WebScheduleInfo's ActiveResource by default.
You can modify the resource that owns an Activity by changing its ResourceKey to refer to a different resource and updating your underlying data source; the include data provider controls feature an administrative API ( UpdateActivity(Activity) ) that you can call to update an Activity outside normal WebSchedule operations. If you do update several activities, you should batch them together early in page processing and re-call DataBind( ) on the WebScheduleInfo so that the Activities rendered to the views are the latest and most up-to-date ones.
An Activity must always have a Resource that owns it. You can effectively detach the Resource from the Activity by changing it's ResourceKey to that of the Unassigned Resource.
Derek,
Thanks for the reply.The AppointmentAdd.aspx/ascx could easily add a dropdownlist of Resources so the user could create or modify an appointment along with the "Resource". It would seem logical that this would be what a user would want to do without having to get a developer to make code changes.
Sometimes everyone thinks only in the terms of writing code. Since the AppointmentAdd.ascx lets a user do everything else, Add Appointment, Delete Appointment, Recurrence, why not allow them to change the "Resource" also?thanks again,mikez