Gossamer Forum
Home : Products : DBMan : Customization :

Preview Mod ??

Quote Reply
Preview Mod ??
I have implemented many mods to DBMan and extensively use the preivew mod. Now CLients have gotten lazy and are using "BACK" after they've submitted a record. The go back one screen (to the preview screen) make modifications and resubmit the record!

The second submit gives them a new record with the SAME ID Number! Has anyone found a way for DBMan to check and see if an ID already exists before it adds the record to the data file again??

Aren't users and Mondays fun????????

Thanks for any help!
Lynette
Hollister, Ca
Quote Reply
Re: [ltillner] Preview Mod ?? In reply to
I may be confused on this one, but I thought the default dbman setup would auto increase the ID number (or even words as ID's) based on the value of the count file.

I have seen some threads where it appears people are disabling that feature, and perhaps with so many MODS you have managed to do the same.

This problem is not unique to DBman, for example FEDEX warns me not to go back, and begs me to be patient, and heaven forbid I double-click, I get 2 of the same order. What fun.

So in a nutshell, even with DBman assigning a different ID, you still have extra junk records laying around.

I'll think about it, I'm thinking about loading the preview in a new window (yes a popup) and closing the original window (not sure java can do that), but at least the back button in the new window goes NOWHERE!
Quote Reply
Re: [joematt] Preview Mod ?? In reply to
Thanks Joe,



It's the preview module that causes there to be two identical id's. It's by design. Preview allows you to edit a record before it's submitted --- so, if they use the "Back" button, they defeat the purpose of preview anyway!

I told our trainer not to train users to use the back button! She thought it was a "neat shortcut" until we figured out the problems it caused!



Thanks again,

Lynette
Lynette
Hollister, Ca
Quote Reply
Re: [ltillner] Preview Mod ?? In reply to
Try this:

Prevent Duplicate ID # due to page Reload

in HTML.PL

Add this to top of your file for reference of changes made:
### prevent NEW ID on reload - added codes in sub html_add_failure

sub html_add_failure {
# --------------------------------------------------------

AFTER:
my ($message) = $_[0]; add:

### prevent dup ID # . . also commented out code in .cgi sub add_record ###
if ($message eq "duplicate key error") {
&html_home;
return;
}
### prevent dup ID numbers ####

In your .CGI: in sub add_record

Add this to top of your file for reference of changes made:
# prevent NEW ID on reload - removed codes in sub add_record

AFTER: # First we validate the record to make sure the addition is ok.
$status = &validate_record;

##### comment out the following to prevent a new ID # being assigned when the
form is reloaded ####
## We keep checking for the next available key, or until we've tried 50 times after
which we give up.
# while ($status eq "duplicate key error" and $db_key_track) {
# return "duplicate key error" if ($counter++ > 50);
# $in{$db_key}++;
# $status = &validate_record;
# }

This is fully tested and works great!

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/