Gossamer Forum
Home : Products : DBMan : Customization :

Auto Fill When Adding Another MOD

Quote Reply
Auto Fill When Adding Another MOD
Hi all,

Can someone help me pls, I'm using the mod "Auto Fill When Adding Another" which works great except when a user has more then one records in the database the mod imports the first records information which is correct. What I want to do is import the last record that the use has added.

Here is the code form the mod

if ($in{'add_form'}) {
$in{$db_cols[$auth_user_field]} = $db_userid;
my ($status2,@hits2) = &query(''mod'');
if ($status2 eq 'ok') {
%rec2 = &array_to_hash(0,@hits2);
# At this point, assign the fields that you want to autofill
$rec{'FieldName'} = $rec2{'FieldName'};
}
}

Any ideas on what has to change in the above code to search for the last record the eser has added.

Thanks...