Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Populating grid through edit form
Message
De
21/06/2000 12:37:02
Gerald McKinsey
Keystone Consulting Services, Inc.
Yorktown, Indiana, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00382529
Message ID:
00382768
Vues:
17
Alex,

Are you sure you meant to say thisform.save() ? The reason I ask is because I don't think that's the way to save anything. I'm not even sure what that would try to save (maybe trickle down to PrimaryBizObj's Save())

I'm not sure what you're doing in the modal form, you made reference to adding treatments, so I'm going to assume that you're adding multiple child Treatment records per 1 Request parent record. You said you got all the data to save, except the requestid.
How are you making your Treatment records? You should be using TreatmentsObj.New() for each one. Then in the TreatmentsObj.PreSaveHook() place your elusive "replace requestiid with v_requests.iid". Then call TreatmentsObj.Save(). That will call the presavehook of the bizobj. If your v_requests.iid has lost scope for some reason (due to being on another form) then sending the v_request.iid value with when you make the modal form with DOFORM should solve that.

That's the best I can do without knowing how you made the treatments partially save in the first place.

However, with all that said, I'd still do it differently, and just let Kevin's MM do all the work:
1. Instead of using a grid, use cListObjEdit (nice grid, that comes with fully functional NEW, EDIT, DELETE buttons already)
2. By making cListObjEdit.cEditForm property to equal to the modal form you made, it will launch this whenever you click on NEW or EDIT button. For Edit, the components on the page will show the values of that record you're editing, for NEW, you'll get a blank screen waiting for new values. Hit SAVE on that page, and you'll save those values, and return back to first screen with the grid.
3. Instead of using any ol' Modal Form mentioned in #2, use cListObjEditForm. This comes with SAVE & Cancel buttons, and have reference to the calling form through it's oCallingForm property.
4. Back to your example, by clicking on the built-in NEW button in cListObjEdit grid, he already calls TreatmentObj.New() and then loads the form to add the data. After typing in the data form this new record, click on the SAVE button, and he calls TreatmentObj.Save(), which will of course call any code you place in TreatmentObj.PreSaveHook()

Hope that's in the ballpark,
Dustin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform