NetTalk Central

Author Topic: NetWebPage - Delete Record  (Read 2501 times)

David

  • Full Member
  • ***
  • Posts: 127
    • View Profile
NetWebPage - Delete Record
« 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: NetWebPage - Delete Record
« Reply #1 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

David

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Re: NetWebPage - Delete Record
« Reply #2 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?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: NetWebPage - Delete Record
« Reply #3 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

David

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Re: NetWebPage - Delete Record
« Reply #4 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()