Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Caller form to search form to data entry and back
Message
 
À
08/02/2016 15:20:36
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Database:
MS SQL Server
Divers
Thread ID:
01631070
Message ID:
01631072
Vues:
80
>Just occurred to me that back in FPD days we were doing something I've never seen demoed in any tool... because it's a tad complicated. And "why would anyone need that" is the question with a ready answer.
>
>Here's the scenario. Form for data entry of a document (or anything else, for that matter), and at some point you need to create a FK into a lookup table. The lookup table is either too long or too wide for a combo, so there's a search form which opens up (this is where practically every demo loses me, they never have anything but combo at this point). In that search form you find your lookup record, except you notice a glaring error (ommision or commision, irrelevant) or you simply don't find it. You open up the lookup editing form (or if you're Mike Yearwood, it's the same form - right, Mike? - so you do it on the spot in the search form). Save the changed record in the lookup, return the PK of the found or edited or added record to the caller form... and, sheesh, you now need to refresh the cursor, assuming it wasn't the same cursor as in the lookup search and/or edit form. So you refresh that and we live happily ever after.
>
>Except that
>1) a friend of mine is trying to learn c# and can't find a single example of the described scenario (actually can't even find how to refresh one cursor in a dataset or whichever data plough he's using)(Yes, Bonnie, you know who). Is it possible that nobody out there didn't have the need for such a scenario (and the ready answer to that question is "because we're introducing the system to a new customer and they want to create documents right away and fill the lookups as needed, not spend a week doing that before creating any documents, so we have to have this add-lookup-records-on-the-fly feature") or
>2) is it possible that it was done thousands of times but my friend has ten thumbs when googling the scenario
>3) or is it a completely different world than what we have here so they all did it but nobody is publishing because they aren't paid for it?
>
>So just for internal reference (and an internal bet), did you do this? In Fox, that is. I'm not expecting that anyone did it in .net, that's where "things are done in a different way", as I was told.
>
>(on the question of how to do it in c#... I don't care, let him suffer, and I don't want to know)

Assuming I understand this right - it does sound like something I've done in the past - and it was a real pain to get it to work - but it turned out really nice.
What I did was:
1. First I used remote views for everything - and created a classlib with a timer in it.
2. Anytime a view is requerried, I kept track of the parameter(s) that were used to requerry the views. I did this by keeping an array in that class that kept all the view names, variables, and values for those variables used to refresh the view.
3. ThenI put this class on each of my forms. Now if the user is NOT in 'edit mode' - I would run the timer gizmo every x seconds (or minutes, depending upon their requirement) - and it would auto-reuqery all the views and refresh the form. If all the data was the same - then no big deal , leave everything alone.
4. Now if the form had gone into 'edit mode' - and now you want to save - then it's necessary to check for conflicts - which my gizmo did also - and then would popup a screen showing the differences and would allow the user to pick which update (s) they wanted to keep.

I spent a HUGE amount of time on this back in around 2001 or 2002 - and it really came out quite nice - one of the things I'm more proud of actually. I really should it in the downloads section sometime but the code was pretty hard to follow and I didn't want to be answering a zillion questions about it so I never did.
ICQ 10556 (ya), 254117
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform