Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I call the confirm delete window manually using ABC? 1

Status
Not open for further replies.

rleiman

Programmer
May 3, 2006
258
US
Hi Everyone,

I would like to trap the calling of the confirm delete window that pops up when the delete button is pressed using the ABC template set.

I am not sure which embed to use.

I plan to do something like this psudo code:

Embed (Can you tell me which one?)

Code to see if any table rows exist in another table.

If there are rows in the other table
Then
Show a message to the user.

Do not call the delete confirm window.
Else
Call the delete confirm window.
End

Thanks

Emad

 
Hi Emad,

I looks to me like WindowManager.PrimeUpdate checks the .DeleteAction and calls into the RelationManager with:

SELF.Response = SELF.Primary.Delete(CHOOSE(SELF.DeleteAction=Delete:Warn))


RelationManager.Delete in turn calls self.DeferedRelations() which is calls virtual methods to build a queue of relations. This queue is then used to call into the filemanagers of each releated file.

RetVal = SELF.Relations.File.DeleteSecondary(SELF.Relations.HisKey,SELF.Relations.Fields,SELF.Relations.DeleteMode,ChildQuery)


The return value is then checked. If any of the return values are non-benign then the delete transaction has a ROLLBACK run.

Now looking at the RelationManager.DeleteSecondary it seems apparent that the MODE argument can be set to RI:Restrict which then fails (returns level:notify) when records are found.

The REAL answer: Set this up in your DICTIONARY via the Relational Integrity (RI).

If this is a special case, where sometimes you need this form of RI then let me know, and we can try to figure that one out, the relation manager isn't designed to make it real straight forward.

-- Mark Goldberg
 
Hi Mark,

Thanks for the reply.

I found the embed "before delete".

Is there a variable or something like that I can initialize that will tell the confirm delete window not to be displayed?

Thanks.

Truly,
Emad
 
It's even easier than that. There is a template prompt.
Extensions ->
Update <tablename> on Disk ->
Messages and Titles ->
When Called For Delete

In many cases you'll see the Messages and Titles button on the procedure properties window, saving you a few clicks.

HTH,
Mark
 
Hi Mark,

Thanks for the help. I found the prompts.

Truly,
Emad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top