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?


11 Replies 1 reply marked as answer

BL Blazor May 21, 2023 09:43 PM UTC

Here is some code 




VD Vinitha Devi Murugan Syncfusion Team May 22, 2023 10:59 AM UTC


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


Marked as answer

BL Blazor May 22, 2023 02:03 PM UTC


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.



VD Vinitha Devi Murugan Syncfusion Team May 23, 2023 10:57 AM UTC

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



BL Blazor June 16, 2023 10:28 PM UTC

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



SK Satheesh Kumar Balasubramanian Syncfusion Team June 19, 2023 12:44 PM UTC

Hi Blazor,

We have checked your reported query and let you know that ODATA post will be send only after OnActionBegin, not in ActionCompleted which is the default behavior of the schedule. You can refer the below links to validate arguments in server side.


If you still face issue in achieving your use case, can you please share more details about your use case?

Regards,
Satheesh Kumar B



BL Blazor June 20, 2023 08:12 AM UTC

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



SR Swathi Ravi Syncfusion Team June 20, 2023 10:34 AM UTC

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



BL Blazor June 20, 2023 03:51 PM UTC

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.



BL Blazor June 20, 2023 05:34 PM UTC

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



RV Ravikumar Venkatesan Syncfusion Team June 21, 2023 05:59 PM UTC

Dear Customer,


Let us know if you need any further assistance.


Loader.
Up arrow icon