How can I get my CustomAppointment field (I'm using my custom data provider with my custom database), for example, "CustomerId" to pass to custom form?
Can we extend CSOM by adding our custom JS functions like getCustomerId here?
function WebScheduleInfo1_ActivityDialogOpening(oScheduleInfo, oEvent, oDialog, oActivity)
{
oEvent.cancel = true; //Cancel default form
var StartTime = oActivity.getStartDateTime()
var CustomerId = oActivity.getCustomerId() //Get my CustomAppointment field "CustomerId" to pass to custom form
window.showModalDialog("CustomForm.aspx?CustomerId=" + CustomerId + "&StartTime=" + StartTime);
}
Thanks,
Alex
Thanks for your response. I have looked into js files - there is quite a lot of code. Mostly, I was surprised by hard-coded control ids. I think I will have to follow your suggestions, since my personal experience with customization points in the same direction.
thats what I was doing firstime, but then I realize, creating my custom appointment and class would mean modifying the WebScheduleInfo events, Appointment dialog, Recurrence screen, the dataprovider, javascript files (have you peeked into those? no code comments) etc, etc..
What I ended up doing is just leave the whole thing in place and use AJAX and Session to store my custom fields. Not pretty but it works.
this is an interesting idea. But it solves only part of the problem - getting stored info on the client side.
I was trying to extend Appointment class also, and now I am stuck because I do not understand how I can use my new extended class in WebScheduleInfo class. For instance, if I want to store my Appointment object into the DB, I need to pass its properties through the java script objects and then the call back will store them. Also, even though I have my own custom provider, WebScheduleInfo has collection Appointments that can store standard Infragistics Appointments, but won't store mine. So, I guess the question is how do I store my custom Appointment object into the DB? I probably missed something in tutorials or in docs, so please excuse my ignorance, but I really could use a hint.
Alex,
My advice to you would be to add a 'hashtable' where you store CustomerID's based on an Activity's DataKey. This will probably be a lot easier that trying to modify the scripts. For example
var _CustomerLookup={"8392342":"ALFKI", "8232320":"ANTON"};
function getCustomerIDForActivity(activity){ return _CustomerLookup[activity.getDataKey()];}
Hope this helps,
-Tony