multi-update post processing

This public forum is for user-to-user discussions of ASPMaker. Note that this is not support forum.

multi-update post processing

Postby gwo » Sat Nov 25, 2017 3:20 am

After a multi-update is performed, where would I insert code that would allow me to update related tables?
I would need access to all the primary record id's selected to multi-update + the selected update fields.

Thank You
gwo
 
Posts: 38
Joined: Wed Mar 25, 2015 3:44 am

Re: multi-update post processing

Postby motfs » Sat Nov 25, 2017 9:39 am

Use Row_Updating or Row_Updated server event to add your code and check the page id to process your code, e.g.:

If CurrentPageID = "update" Then
' your code
End If
motfs
 
Posts: 710
Joined: Tue Sep 08, 2015 4:55 pm

Re: multi-update post processing

Postby gwo » Sat Nov 25, 2017 3:57 pm

Thanks...
How do I find which records were selected for updating?
gwo
 
Posts: 38
Joined: Wed Mar 25, 2015 3:44 am

Re: multi-update post processing

Postby motfs » Mon Nov 27, 2017 10:58 am

You can get the key data by rsold("key").
motfs
 
Posts: 710
Joined: Tue Sep 08, 2015 4:55 pm

Re: multi-update post processing

Postby gwo » Wed Nov 29, 2017 1:13 am

I'm not explaining myself very well.
I understand using rsold().
Let me expand.

In multi-update I select 10 records, complete the fields to to be updated, submit, etc.

Now, I need to then process these 10 records after the update and update some other tables depending on what fields were updated.

The question is ... How can I determine which ten records were selected and updated, after the multi-update occurs?

Thanks
gwo
 
Posts: 38
Joined: Wed Mar 25, 2015 3:44 am

Re: multi-update post processing

Postby motfs » Wed Nov 29, 2017 9:44 am

> How can I determine which ten records were selected and updated

You know which records are selected by rsold("<Key>"). Also, you need to compare rsnew("<Field>") and rsold("<Field>") to see if there is any change so you know which record has been changed and which field has been modified. Then, you can execute your Update statement based on the result.
motfs
 
Posts: 710
Joined: Tue Sep 08, 2015 4:55 pm

Re: multi-update post processing

Postby gwo » Thu Nov 30, 2017 2:49 am

Hi

I think I don't understand what you mean by "key".

If I select 3 records, multi-update, and look at the value returned in
Row_Updated
i.e. rsold("msku_id") it returns one record id only, but 3 records were updated.
gwo
 
Posts: 38
Joined: Wed Mar 25, 2015 3:44 am

Re: multi-update post processing

Postby Webmaster » Thu Nov 30, 2017 11:11 am

The Row_Updating / Row_Updated server events are executed for every record being updated. If you are updating three records, they are executed three times for each record.
Webmaster
 
Posts: 10731
Joined: Fri Aug 06, 2004 5:59 pm


Return to General Discussion (ASPMaker)