Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
142
How can I get my CustomAppointment field value on the client side to pass to my custom dialog form?
posted

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

Parents
  • 19308
    posted

    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

Reply Children