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.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ger Cannoll - 14 Years Ago
Greg McGuffey - 14 Years Ago
Ger Cannoll - 14 Years Ago
                 Any feedback on this appreciated
Ger Cannoll - 14 Years Ago
                     Hi Gerard. This is a good post to follow:...
Ivan George Borges - 14 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search