This topic is locked
[SOLVED]

 Event for After Group Of Records Updated

2/27/2019 10:05:08 AM
ASPRunner.NET General questions
D
DCherrington author

In my project, I'm currently using the following code to call a procedure on the After record updatedevent under the Edit page section

tDAL.CustomQuery("EXEC psyRefreshtblPrimaryDataset");


I'm currently using in-line edit in this particular instance, where users will quickly select or deselect a series of checkboxes on a list page. I have the row click action set to do inline edit, so effectively two clicks for each row with activate in-line edit and change my field value between 1 and 0. When the user has a number rows changed, I want them to be able to select the Save All button to update the records as a batch. This in itself is not an issue as my table will update fine. However, this process calls the procedure quoted above for each record being updated in the batch. Not an ideal situation I'm sure you can agree.
I noticed that there is an After group of records deleted event on the list page, and wondered if there was something that I could do to mimic an After group of records updated event, or perhaps a way to trigger my procedure call upon leaving the list page?
Any clues?

admin 2/27/2019

We do not have "After group of records updated" event. Probably in AfterEdit event you can set a session variable and in AfterAppInit event check this variable value, execute stored procedure and clear this session variable.
Something like this:

if (XSession.Session["flag"]!="") {

tDAL.CustomQuery("EXEC psyRefreshtblPrimaryDataset");

XSession.Session["flag"]="";

}
D
DCherrington author 2/27/2019



We do not have "After group of records updated" event. Probably in AfterEdit event you can set a session variable and in AfterAppInit event check this variable value, execute stored procedure and clear this session variable.
Something like this:

if (XSession.Session["flag"]!="") {

tDAL.CustomQuery("EXEC psyRefreshtblPrimaryDataset");

XSession.Session["flag"]="";

}



Thanks Sergey, have tried this but the After application initialized event is being triggered after each row update, which is effectively having the same effect as putting it on AfterEdit

D
DCherrington author 2/28/2019

I've decided to put a button at the top of relevant pages, and stored the procedure call in that instead. This works well for what I need and avoids calling of the procedure multiple times.