Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pre-Populating on Insert 1

Status
Not open for further replies.

wchestnut

Programmer
Aug 9, 2010
79
US
Hi, ShankarJ! :)

I have a pretty standard Browse window with the typical Insert, Change and Delete buttons.

For some reason, now when the Insert button is pressed, the Update windows is now pre-populating the same field values from the selection in the Browse window instead of empty field to enter new information. If I save the new record without making any changes, I end up with a duplicate record. I tried adding Embeds on the Insert button to manually zero-out/blank fields as a workaround, but of course that doesn't work.

This was working correctly for a while but just started doing this and I don't know what I might have changed to cause it.
 
Hi!

Are you sure you have not changed the values of the GlobalRequest or SELF.Request or SELF.OriginalRequest in your Form procedure.

Is the Form (Update) procedure a standard Form procedure?

Are you using ABC or Legacy template chain?

Regards
 
I'm not familiar with nor advanced enough to change those settings in the Forms procedure -- yet. :)

Yes, it's a standard Form procedure.

I believe I'm using the legacy template. I'm basing that on what you asked in the previous message you helped me with.
 
Hi!

If I am understanding you correctly, you have ::

A Standard Browse procedure (created from the Default or Wizard) calling an Update Form Procedure (also created from the Default or Wizard). There are no other 3rd Party templates in these procedures and somehow the Insert action is becoming a Change Action. Is the table in question having an Auto-numbered key?

The best way to debug this is either step through using the debugger OR check the generated source to see why it is going wrong OR post the generated source code (CLW) here or e-mail me direct at (j s h a n k a r @ e i m . a e) for me to check the source.

Regards
 
Yes, standard Browse calling an Update Form Procedure. No 3rd party templates that I'm aware of. All of my other Browse/Update screens in this Application work correctly. It's just this one that changed recently somehow.

The default new Form wizard creates a "ActionMessage" field next to the OK and Cancel buttons. When I click Insert, it says "Record will be added". On Change, "Record will be changed" so the functions seem to be correct. If I cancel on a Change without making any changes, nothing happens. If I Cancel on an Insert, I'm prompted to save the record.

I'm familiar with stepping through in VB... I'll see if I can figure out out in Clarion.
 
Well, ironically enough, Debug crashed on me. I've got a fairly plain XP installation but it seems to be so fragile with programs easily crashing if something's not set correctly. Oh well.

I figured out the problem, which kind of creates a new one.

After creating the Browse in question, I noticed it wasn't sorting the list in the order I needed. I tried to change the Key in the Files screen, but the order I wanted was in a sub-related file. The only way I know how to change the Browse sort order (off-hand) is to change the order in the Files configuration and choosing the correct Key.

So, I changed the Files configuration and re-arranged it so another table was the "primary" table for the sort and the one I need to allow Change/Insert/Delete is a sub-related table.

Now I guess the app thinks I want to Change the new primary related file instead of the sub-related table and the Insert is pre-filling the fields because it's not looking at the right table and/or it has something to do with a record pointer.

I think I have to go back and undo the order in Files back to the original where the table I need to Change is the primary table and the rest are relations. That's probably the proper thing to do and the only way the Insert is going to come up with blank field.

So can I change the sort in a Browse either with or without Keys specifying any one or a number of columns? If so, how and where would I do it?

I really appreciate your help.
 
I think I have to undo my undo and keep the Files associated with the Browse as-is with the primary file being a related table to the one I need to Insert/Change/Delete. I have a pull-down object filtering out records and a correct sort working the way it is.

Since the fields are pre-filled with data from the record selected, I'm hoping there is way to manually blank out (='' and=0) fields before the Update procedure. I'm thinking all I need to do is add an Embed Source Code on the Update form. I guess "On Insert, after record is primed" and added all the fields with blank values and it worked.


I wish I had the time and resources to go through proper training for Clarion, but I have to resort to diving in and learning the parts I need to in order to complete this last project before I move it to another platform. Thanks, again, for your help. I really appreciate it.
 
Hi!

I wish that you are using the ABC template chain as I am totally out of touch with the legacy one.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top