How can i prevent odata post request while my schedular connected to odata?
Hi,
I am using schedular . It is connected to odata brings data perfectly.
For to insert data, i want to use "ActionCompleted" event and my api's.
But schedular trying to send "ODATA POST" request after "OnActionBegin" event.
How can i prevent odata post request while my schedular connected to odata?
Here is some code
Dear Customer,
You can prevent an OData POST request for inserting data by using the OnActionBegin event with the following code. Please try the code and let us know if you need further assistance.
public void OnActionBegin(ActionEventArgs<AppointmentData> args)
{
if (args.ActionType == ActionType.EventCreate) //To check for request type is event crate`
{
args.Cancel = true; //To prevent the appointment creation and post.
}
}
Regards,
Vinitha
Yes it prevents ODATA post request, but it also prevents to pass OnActionCompated event automaticaly.
Shoud i call
OnActionCompated event from
OnActionBegin event by code? Like below;
public void OnActionBegin(ActionEventArgs<AppointmentData> args)
{
if (args.ActionType == ActionType.EventCreate) //To check for request type is event crate`
{
await OnActionCompleted(args);
args.Cancel = true;
}
}
Then i have to close also editor Popup by code.
Dear Customer,
Yes, you can use the code you shared to manually trigger the `actionComplete` event. If you need any further assistance, please feel free to ask.
Regards,
Vinitha
Hi , here is problem if i will call
OnActionCompleted from OnActionBegin
When there is recurrence event and when i want to change sinle item from series.
In
OnActionBegin there is only ChangedRecords. filled.
But In OnActionCompleted ChangedRecord and Added Records are filled.
So if i call
OnActionCompleted
from OnActionBegin Added Records are missing .
I shoulnt miss added records. Th
Hi Satheesh,
Thanks for attention.
Firs of all i dont want to send odata post request from by schedular.
I wish i can prevent it. I want to use "ActionCompleted" for saving my events.
But unfortunately ActionCompleted is not triggers.
So if i use odata I cant use ActionCompleted .ok
Dear Customer,
We suggest that you can use the CustomAdaptor instead of ODataV4Adaptor to achieve your requirement. Refer to the below shared UG and demo to know how to use CustomAdaptor in Scheduler.
UG: https://blazor.syncfusion.com/documentation/scheduler/data-binding#custom-binding
Demo: https://blazor.syncfusion.com/demos/scheduler/custom-binding?theme=fluent
I am using IncludeFiltersInQuery feature
<ScheduleEventSettings IncludeFiltersInQuery="true" Query="@ScheduleQuery" TValue="PlanDto">
Is it possible to have same behaviour in
CustomAdaptor ?
I think no. I need to filter my events in schedular whilie fetching based uppon dates.
Recurrence events are hard to filter with dates.
I found a workaround.
I have created post and patch method on controller but they are empty. (I dont want to insert anything thing there)
After post and patch request finsihes, OnActionCompleted event triggers like i want. Finnaly!!
Odata Batch requests also hand
Dear Customer,
Let us know if you need any further assistance.
- 11 Replies
- 5 Participants
- Marked answer
-
BL Blazor
- May 21, 2023 09:42 PM UTC
- Jun 21, 2023 05:59 PM UTC