NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: ccordes on February 14, 2011, 04:46:37 PM

Title: Can not delete a record
Post by: ccordes 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
Title: Re: Can not delete a record
Post by: Bruce 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


Title: Re: Can not delete a record
Post by: ccordes 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.
Title: Re: Can not delete a record
Post by: Bruce 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

Title: Re: Can not delete a record
Post by: ccordes 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.