The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Capture Ctrl-D event in mainview
Posted: 02 Nov 07 8:05 AM
|
I have two mainviews, mv1 and mv2. Mv2 displays some ready only data from mv1 as well as some of its own. Some of the tables associated with mv1 store an ID from the main table for mv2. When someone deletes a record in mv2 I need to clear out the ID's in mv1. So I am wondering if there is a way to capture the delete event of mv2 so I can update the ID's in other tables to null. Is this possible? Thanks |
|
|
|
Re: Capture Ctrl-D event in mainview
Posted: 02 Nov 07 8:55 AM
|
Create a new Global Script. In script type the code:
Function OnBeforeFunctionExecute_EditDeleteItem(functionNumber, functionName) if Application.MainViews.ActiveView.Caption = "YOUR MAIN VIEW" then 'Your Code end if end function
The list of standard functions you can view in SECFUNCTIONS table |
|
|
|
Re: Capture Ctrl-D event in mainview
Posted: 02 Nov 07 8:57 AM
|
I forgot. If you want "cancel" function you must return false in function body, for example:
OnBeforeFunctionExecute_EditDeleteItem = false |
|
|
|
Re: Capture Ctrl-D event in mainview
Posted: 02 Nov 07 9:51 AM
|
Thanks Vladimir. Very helpful. Is there a way to get the ID of the record being deleted? I also need to capture this from the Edit/Delete option, I am hoping I can get the ID of detail record about to be deleted from each location.. |
|
|
|
Re: Capture Ctrl-D event in mainview
Posted: 02 Nov 07 10:12 AM
|
You can try Application.BasicFunctions.CurrentViewID. This function returns current record ID of active mainview.
Edited. You can also try Application.MainViews.ActiveView.CurrentID |
|
|
|