Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating view from left outer join tables
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00188347
Message ID:
00188776
Vues:
43
>I have a form based on the CBizObjMaintenanceForm.
>On this a BizObj with a view that is a SQL join between my employee and zipcodes table.
>In the employee table the foreign key to the zipcodes table is stored.
>Because I want to show the zipcode as well as the city for the employee in the CGrisList, I have the view created like this.
>This as well leaves the possibility of ordering on the zipcode or city and I don't have to care about setting relations.
>Which leaves it all less fox related.
>
>But now when changes are made for the employee's localization.
>Change either the zipcode or city the foreign key of the zipcode table is changed in my employee table.
>But when I return to the grid, these changes (new zipcode/city) aren't reflected in the view because it is not requeried.
>
>I already tried putting it in the page1.Activate() but this is really overkill and from time to time not working properly.
>Then I tried to do the EmployeeBizObj::Requery() from within its PostSaveHook() but no luck there because the save is included within a transaction.
>
>Any suggestions.

Yves,

In the original Codebook, in the save of the invoice (just an example)
IF CURSORGETPROP("SOURCETYPE") <> DB_SRCTABLE
*-- Update the view's nInvoiceTotal field. This is field
*-- is a calculated field in the view, so no updates will
*-- be done to the back end.
REPLACE ninvoicetotal with this.oChildBizObj.GetTotal()
ENDIF

So what I do now is something similar in the hook that comes just after the save. So when going to the list, the changes are reflected in the grid without the need to requery anything.

José
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform