Adding and Editing records


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I am in the process of writing  forms to Add/Edit records and would welcome some guidance on best practice for this.  I have a parent BO and Child BO and want to Save back to the database at the Parent Level. On my Child Form, I have the various fields, and then a Save and Cancel button. My pseudo code for the Child BO is:

Adding:
  MyBO.Add   // Add the BO record
  MYBO.EDIT // (Must I put the BO into Edit Mode to be able to edit the record just added ?
     ....... edit the various fields 
 
Editing
  MyBO.EDit
     ....... edit the various fields


Save/Cancel Buttons
if no Errors and want to save  .... Do nothing as BO's will be saved from Parent Form
If Errors  or I Choose to Abort the Changes ......
Case:
  (1) If was adding a record......BO.DeleteCurrentRow() or Revert to original state of BO;   //I no longer want the record added
  (2) If I was Editing a record ...... Revert to original state of BO  // want to keep the state prior to editing

I am not sure how to use the EditingState, as I need to kow whether I am adding a new row or editing an exisitng row, but it would appear that I need to have EditingMode = Editing to be able to edit either the new or exisitng record.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Are you managing the parent and child data on the same form or using ChildFormDialogs or you're own dialogs?
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Greg.

I am using childFormDialog. I have a Header Form for Invoice header details like Invocie No. Invoice Date and Customer Number (With a Save and Cancel Button where I want to Save All BO's (i.e. parent and Child ) out to disk.

 On the Child Form, I have a Save, Cancel, which is really just for the user, so that they can 'Save' each child record, but no saving is done to Disk until the user selects Save from the parent form.

The 'Save' on the child form is  really an indicator for the User , to finish with the current record and 'Add' another child record.

When all is done, i.e. All header data is input (parent BO) and all the child records have been input by the user, I want to Save the Parent and Child records to disk.

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Any feedback on this appreciated
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Gerard.

This is a good post to follow:

http://forum.strataframe.net/FindPost18089.aspx

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search