NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: David on January 29, 2009, 05:31:25 PM

Title: NetWebPage - Delete Record
Post by: David on January 29, 2009, 05:31:25 PM
I have a table that is related to several other tables.  On a NetWebPage, I want to delete a record and then based on the dct relationships delete records in the other related tables.

In a regular Clarion app I would do something like: Relate:MyTable.DeleteRecord(false)

When using a NetWebForm, the process works automagically, looking at the NetWebForm source, I can't find the delete code, so I can't duplicate it.

Long question short, how do I delete a table record with relational integrity on a NetWebPage?

Thank you.
David
Title: Re: NetWebPage - Delete Record
Post by: Bruce on January 29, 2009, 10:43:49 PM
Hi David,

If I'm not mistaken the Delete in a NetWebForm is a Relate:Delete anyway.

However there are ValidateDelete and PostDelete embed points on the form where you can do additional things if you want.

For example, in ValidateDelete you can do the delete manually, and then set the
ans = 0
(meaning "no further action required")

Cheers
Bruce
Title: Re: NetWebPage - Delete Record
Post by: David on January 30, 2009, 06:02:18 AM
Bruce,

No, I am trying to do a Relate:Delete in a NetWebPage.  I have added the tables, clicked generate open/close routines which are something like p_web._open(MyTable).  But how do I hand code a request to delete a record inside the NetWebPage?
Title: Re: NetWebPage - Delete Record
Post by: Bruce on January 30, 2009, 06:46:36 AM
The NetTalk program is a regular clarion program.

So if you want to do a delete in hand-code, then just do a delete in hand-code.
ie
Relate:MyTable.DeleteRecord(false)

It's all good...

Cheers
Bruce
Title: Re: NetWebPage - Delete Record
Post by: David on January 30, 2009, 11:41:33 AM
My Bad.....

I have never hand coded the Relate:MyTable stuff before.  I thought that the Relate: was a complete replacement for the Access: code.  So, Relate:MyTable.Fetch() and Relate:MyTable.DeleteRecord() where giving compile errors and I thought the Relate class was not being generated in the NetWebPage.

Now I know:

Access:MyTable.Fetch(PK)
Relate:MyTable.Delete()