main logo
Subject: Re: Best Practise - Creating Default records, .New() .Save() doesn't, INSERT INTO does
Author: Bhavbhuti Nathwani
Posted: 2002/02/13 23:47:13
 
View Entire Thread
New Search


What was happening is that using new() save(). I do get a new() record and I populate with the replace command and save() after this a browse will show a blank record. Now onto the next record, I again get a new() but when the replace occurs it occurs in the previous record and the new record is blank. so on...

I will change the code from aApp to the BO, it didn't strike me I'm still thinking procedurarily rather than OOP.

<i><font color="#663300"><i><font color="#663300">I wanted to created default records when the apps start, this is what I have done.</font></i>

First off, you should think about the design of your app, and where your code is going. Your example has VFP data commands hard-coded into your app. While the triggering of these default records may be the responsibility of the app, the actual creation and storage belongs in the bizobj. I would add a custom method to the bizobj to create these records, and another to determine if new records need to be created, etc. In other words, if you are making decisions about the MAccounts table, those decisions belong in the bizobj for that table.

Second, when you say that calling the New() and Save() methods of the bizobj "doesn't work", what exactly does that mean? Have you stepped through the code to see why it isn't working?
</font></i>

Regards
Bhavbhuti
 
©2002 Bhavbhuti Nathwani
<-- Prior Message New Search Next Message -->