Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Show change inf form a from form B, Private Datasessions
Message
From
05/01/2001 12:53:16
 
 
To
04/01/2001 23:20:26
George Simon
GS Data Technologies, LLC
Cincinnati, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00459114
Message ID:
00459905
Views:
28
>>This is the part I am having trouble with. Currently inventory table instock
>is the data environment of both forms. Should it be? Then how does the method
>access lastest value of nqty in instock?
>
>Since I don't know all of the functionality that's built into Form A it's hard for me to say if you should open the instock table. (For example, Form A may adjust the instock.nQty when you save the order.) But for the lookup validation, I prefer to use views like this:

Yes it does update nqty, replaces nqty with nqty - qtyissued, which is why instock is included in the data
environment. There are two problems I have with using private data session in this case. Both seem to
be related to fact that orders form A does not see changes made by inventory maintenance form B.

1. Is the validation problem which could be solved by using a view
2. When updating the instock table the original value of nqty is used so that it results in negative values for nqty,
This is a major issue. Not sure what best approch is here.

>
>Create your view...
>
>CREATE SQL VIEW lv_InStockItem AS ;
>SELECT * FROM instock ;
>WHERE instockID = ?vp_InStockID
>
>Now in the StockTooLow() method :
>
>FUNCTION StockTooLow
>LPARAMETERS tnInStockID, tnCheckValue
>
>*-- set your view parameter.
>LOCAL vp_InStockID
>vp_InStockID = tnInStockID
>
>*-- Skip this part if you open the view in the form's Load().
>IF NOT USED('lv_InStockItem')
> USE lv_InStockItem IN 0 NODATA
>ENDIF
>
>*-- Now get the latest data.
>REQUERY('lv_InStockItem')
>
>*-- Now do your validation....
>
>
>By requerying the view you will get the most current data.
>
>HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform