Send a http request when change value of appointment

Hi,

How to send a external http request when appointment values change ?

For exemple, i want to execute a http external request to update the value in our system when a user clic to save data


4 Replies 1 reply marked as answer

RV Ravikumar Venkatesan Syncfusion Team November 27, 2020 03:56 PM UTC

Hi Gilles, 
  
Greetings from Syncfusion support. 
  
We have validated your reported query at our end. When performing the CRUD actions with the Schedule the actionBegin event is called before the CRUD action completed and the actionComplete event is called after the CRUD action completed. You can make your external HTTP request from any of these events as shown in the below code. 
  
[index.js] 
  actionBegin: function(args: ActionEventArgs) { 
    // You can get the event detail from the args. 
    console.log(args.data); 
    if (args.requestType === "eventCreate") { 
      // Here you can send your http request on event save action 
    } else if (args.requestType === "eventChange") { 
      // Here you can send your http request on event update action 
    } else if (args.requestType === "eventRemove") { 
      // Here you can send your http request on event delete action 
    } 
  },  
 actionComplete: function(args: ActionEventArgs) { 
    // You can get the event detail from the args. 
    console.log(args.data); 
    if (args.requestType === "eventCreated") { 
      // Here you can send your http request on event save action 
    } else if (args.requestType === "eventChanged") { 
      // Here you can send your http request on event update action 
    } else if (args.requestType === "eventRemoved") { 
      // Here you can send your http request on event delete action 
    } 
} 
  
  
Kindly try the above solution and get back to us if you need any further assistance. 
  
  
Regards, 
Ravikumar Venkatesan 



PG Pon Geetha A J Syncfusion Team November 30, 2020 06:32 AM UTC

Sent: Friday, November 27, 2020 1:25 PM
To: Syncfusion Support <[email protected]>
Subject: RE: Syncfusion support community forum 160092, Send a http request when change value of appointment, has been updated. 
Hi Ravikumar Venkatesan,

Sorry but I am a real beginner in your environment.
I have attached the source code of my mini project where the ActionComplete code has been added.
It does not work.

Regards





GI Gilles November 30, 2020 05:31 PM UTC

source code of my mini project

Attachment: scheduler_d2adcbf6.zip


RV Ravikumar Venkatesan Syncfusion Team December 1, 2020 06:26 AM UTC

Hi Gilles, 

Thanks for the update. 
  
We have validated your reported query based on your shared sample at our end. We found that you have used the actionComplete event outside of the schedule. Because of that, you have faced the problem. We have added the actionComplete event to the inside of the Schedule object and it works as expected now. We have modified your shared sample at our end which can be available below. 

[index.js] 
var scheduleObj = new ej.schedule.Schedule({ 
  eventSettings: { dataSource: data }, 
  actionComplete: function (args) { 
    // You can get the event detail from the args.  
    console.log(args.data); 
    if (args.requestType === "eventCreated") { 
      // Here you can send your http request on event save action  
    } else if (args.requestType === "eventChanged") { 
      // Here you can send your http request on event update action  
    } else if (args.requestType === "eventRemoved") { 
      // Here you can send your http request on event delete action  
    } 
  } 
}); 


Kindly try the above sample and get back to us if you need any further assistance. 


Regards, 
Ravikumar Venkatesan 


Marked as answer
Loader.
Up arrow icon