NetTalk Central

Author Topic: Can not delete a record  (Read 2577 times)

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Can not delete a record
« on: February 14, 2011, 04:46:37 PM »
I have a delete button on a form. It is a regular button with a URL to a short form that shows data from the order and Are you sure? with the standard Save and Cancel button.
I call it as a URL - rusure?ord__Ordid=ordernumbner&delete_btn=Delete&
I put a ds_debug message in the SetAction The action in that form never gets set to 3.
I also have debug messages in pre_delete and validate_delete , validate_all that don't fire either.
Not sure what I'm doing wrong.

The form does get the record and display the right information.
- AND if I call it with RUSure?ORD__ORDID=4&Change_btn=Change&
The action gets set to 2 as I would expect.

Any suggestion s would be appreciated
Chris
Real programmers use copy con newapp.exe

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Can not delete a record
« Reply #1 on: February 15, 2011, 07:16:28 AM »
Hi Chris,

Forms support a Delete Button.
It's an option on the Form itself.

So if a user clicks on "update" they can then see all the details, and click on "delete".

It would be fairly east to make a second "Change" button, that looks like a "Delete" button, and opens the form in say a "Delete, or Cancel, no Save" type mode. That's something I can look into some time later.

In your case, I'd say keep your custom Delete button, but hide the Save button on the form, and add the Delete button on the form. Then it'll delete without hand-code.

cheers
Bruce



ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Can not delete a record
« Reply #2 on: February 15, 2011, 07:27:43 AM »
I will try that, but I have to ask...
Is the Delete button on the form a validate delete then?
What is the use of the delete_btn=Delete stuff if it doesn't set up or pass the delete action?

chris
-Editted -
Tried adding the Delete button to the RUSure form. Called RUSure?Ord__OrdId=5&Delete_btn=Delete&
Clicked the [Delete] rather than [Save] - no joy. :|
In debugview - I can see the ordid is set, ValidateValue::DelButton but Action never gets set to 3.
« Last Edit: February 15, 2011, 07:37:52 AM by ccordes »
Real programmers use copy con newapp.exe

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Can not delete a record
« Reply #3 on: February 15, 2011, 10:10:48 PM »
Hi Chris,

yes, the delete button on the form is a valid Delete.

There are 2 "approaches" to delete - the delete button on the form, and the delete button on the browse. Clarion (windows) only supports the Delete button on the browse, so the form one is new to NetTalk.

The command-line delete_btn=delete simulates a browse Delete button push. However if you enter the form in change mode (change_btn=change) and the Form delete button is available (form setting) then the user can choose to edit, or delete the record.

I think it would be helpful if you can simulate the effect(s) you are getting using one of the examples, then send that to me so I can attempt to duplicate here.

cheers
Bruce


ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Can not delete a record
« Reply #4 on: February 16, 2011, 08:33:00 AM »
I'll try to do that today.
To get the project going, I just took off the delete button and allowed them to cancel orders which works fine. When it comes to order entry, its better not to delete anything.
Real programmers use copy con newapp.exe