Re: Grid: Row-Level Validation: Solved?

2013-12-02 Thread Gene Wirchenko
At 00:36 2013-11-30, Laurie Alvey truk...@btinternet.com wrote: That is what we did before VFP and buffering. I wouldn't have thought it necessary these days. Neither did I. I am glad that I found a solution, but I do not appreciate how awkward it is. [snip] Sincerely, Gene

Re: Grid: Row-Level Validation: Solved?

2013-11-30 Thread Laurie Alvey
That is what we did before VFP and buffering. I wouldn't have thought it necessary these days. From: Gene Wirchenko ge...@telus.net To: ProFox Email List profox@leafe.com Sent: Friday, 29 November 2013, 19:53 Subject: Grid: Row-Level Validation: Solved?

Re: Grid: Row-Level Validation: Solved?

2013-11-30 Thread AndyHC
+++1 On 30/11/2013 14:06, Laurie Alvey wrote: That is what we did before VFP and buffering. I wouldn't have thought it necessary these days. From: Gene Wirchenko ge...@telus.net To: ProFox Email List profox@leafe.com Sent: Friday, 29 November 2013, 19:53

Re: Grid: Row-Level Validation

2013-11-29 Thread Peter Cushing
Gene Wirchenko wrote: Aren't you contradicting yourself when you state check every time they enter a value? If I check every time, then it will throw an error if I change one of the values. Correcting an error might involve more than one of the controls. That is why the validation is

Re: Grid: Row-Level Validation

2013-11-29 Thread Gene Wirchenko
At 09:54 2013-11-29, Peter Cushing pcush...@whisperingsmith.com wrote: Gene Wirchenko wrote: [snip] My problem is getting the current values of the controls. Other than that, my code works. Unfortunately, not having the current values of the controls makes a mockery of validation

Re: Grid: Row-Level Validation

2013-11-28 Thread Peter Cushing
Gene Wirchenko wrote: I want to use BeforeRowColChange to do the row-level validation, and when it fail, put the focus on one of the controls involved in the error. [snip] Don't think that will work. You explained a rule that said say columns A + B = C + D. If you have a validation rule

Re: Grid: Row-Level Validation

2013-11-28 Thread Gene Wirchenko
At 03:26 2013-11-28, Peter Cushing pcush...@whisperingsmith.com wrote: Gene Wirchenko wrote: I want to use BeforeRowColChange to do the row-level validation, and when it fail, put the focus on one of the controls involved in the error. [snip] Don't think that will work. You explained a rule

Re: Grid: Row-Level Validation

2013-11-28 Thread Eurico Chagas Filho
You have a View and vView.A is in column one of the grid. All the values in vView have not been updated yet. You want to check a new value against the one in the disk( server ). cField= vView.A IF GETFLDSTATE(cField) 1          lChg = EVALUATE(cField) OLDVAL(cField)          IF lChg            

Re: Grid: Row-Level Validation

2013-11-27 Thread Peter Cushing
Gene Wirchenko wrote: I have many browses that I would like to have row-level validation for. I am trying to solve the validation problem in general. The most important case is the work transaction table. It gets data from DE and from importing from other systems used by the

Re: Grid: Row-Level Validation

2013-11-27 Thread Gene Wirchenko
At 03:13 2013-11-27, Peter Cushing pcush...@whisperingsmith.com wrote: Gene Wirchenko wrote: I have many browses that I would like to have row-level validation for. I am trying to solve the validation problem in general. The most important case is the work transaction table. It

Re: Grid: Row-Level Validation

2013-11-27 Thread Eurico Chagas Filho
I would use a View for the header and a View for the details, with that u could insert new records or check old ones. I would check some validation rules in the lostfocus event  and in the beforerowcolchange.  You could use a column in the view to check validation rules and signal that Column+row

Re: Grid: Row-Level Validation

2013-11-26 Thread Peter Cushing
Gene Wirchenko wrote: snip The reason I want what I want is to make adjusting data much easier. The app is client billing. There are various dependencies that need to be manually verified. Any errors detected have to be corrected. This is much easier when one can see many rows at

Re: Grid: Row-Level Validation

2013-11-26 Thread Gene Wirchenko
At 02:51 2013-11-26, Peter Cushing pcush...@whisperingsmith.com wrote: Gene Wirchenko wrote: snip The reason I want what I want is to make adjusting data much easier. The app is client billing. There are various dependencies that need to be manually verified. Any errors detected have

RE: Grid: Row-Level Validation

2013-11-25 Thread Gene Wirchenko
At 18:41 2013-11-22, Ken Dibble krdib...@stny.rr.com wrote: [snip] And due diligence constrains me to point out that a user's eyes, moving left to right (in most countries) while quickly entering data across a wide grid will have a good chance of tracking incorrectly down to the next row,

Re: Grid: Row-Level Validation

2013-11-25 Thread Gene Wirchenko
At 20:00 2013-11-22, AndyHC a...@hawthorncottage.com wrote: If you want to reduce clutter at least look at cursoradapters - they include GetFldState level info and lots more, and they offer a lot of advantages apart from helping with validation. There's plenty of stuff on them in Help!

Re: Grid: Row-Level Validation

2013-11-25 Thread AndyHC
Have a look at the PEMs - including: Methods: AddProperty CursorRefresh RecordRefresh *WriteMethod Method Events: ... AfterCursorRefresh AfterCursorUpdate AfterRecordRefresh BeforeRecordRefresh *BeforeCursorUpdate *BeforeUpdate Error - hth On 26/11/2013 03:15, Gene Wirchenko wrote: At 20:00

RE: Grid: Row-Level Validation

2013-11-22 Thread Dave Crozier
To: ProFox Email List Subject: Re: Grid: Row-Level Validation At 03:51 2013-11-21, Peter Cushing pcush...@whisperingsmith.com wrote: Gene Wirchenko wrote: Dear Vixens and Reynards: I have been working on something else, and now, I come back to grids. I have asked this question before

RE: Grid: Row-Level Validation

2013-11-22 Thread Richard Kaye
Subject: Re: Grid: Row-Level Validation At 16:21 2013-11-20, Sytze de Boer sytze.k...@gmail.com wrote: Maybe you can try this Create a variable before you DO FORM (e.g. mcolnum) In the WHEN of the grid, number all the columns from 1 to whatever mclonum,=1, mcolnum=2 etc In the valid event, DO VALCOL

RE: Grid: Row-Level Validation

2013-11-22 Thread Richard Kaye
column you want the use to review. ENDIF -- rk -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Gene Wirchenko Sent: Thursday, November 21, 2013 1:18 PM To: profoxt...@leafe.com Subject: Re: Grid: Row-Level Validation At 03:51 2013-11-21, Peter

RE: Grid: Row-Level Validation

2013-11-22 Thread MB Software Solutions General Account
On Thu, November 21, 2013 10:24 am, Richard Kaye wrote: As long as we're getting all theoretical here, data validation should not be handled by the grid object. The grid should be able to call out to an object where you store your business rules. Then all your default control valid method code

Re: Grid: Row-Level Validation

2013-11-22 Thread AndyHC
Well if we're getting theoretical, another possible (and actually very good) place for your data validation rules in in a cursoradapter. It has all the update control you could possibly want and - it's been some time - but doesn't a ca draw a grid if you drag it onto a form? On 22/11/2013

RE: Grid: Row-Level Validation

2013-11-22 Thread Richard Kaye
-Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of AndyHC Sent: Friday, November 22, 2013 12:17 PM To: profoxt...@leafe.com Subject: Re: Grid: Row-Level Validation Well if we're getting theoretical, another possible (and actually very good) place for your

RE: Grid: Row-Level Validation

2013-11-22 Thread Gene Wirchenko
At 10:34 2013-11-21, Richard Kaye rk...@invaluable.com wrote: In the beforerowcolchange method, do your row level validations. If that fails then use NODEFAULT to prevent the rowcol change. At least that's what the VFP help implies will accomplish what you want. No kidding. My

RE: Grid: Row-Level Validation

2013-11-22 Thread Gene Wirchenko
At 07:24 2013-11-21, Richard Kaye rk...@invaluable.com wrote: As long as we're getting all theoretical here, data validation should not be What theoretical? I am trying to IMPLEMENT something. [snip] Sincerely, Gene Wirchenko ___ Post

Re: Grid: Row-Level Validation

2013-11-22 Thread Gene Wirchenko
At 11:55 2013-11-21, Fred Taylor fbtay...@gmail.com wrote: Here's a sample that should show you how to do it. Just cut and paste into a .PRG and run it. Note the Form DataCheck method and the Grid.BeforeRowColChange code. Uses data buffering, GETFLDSTATE and OLDVAL. I tried to remove as much

RE: Grid: Row-Level Validation

2013-11-22 Thread Richard Kaye
, 2013 2:25 PM To: profoxt...@leafe.com Subject: RE: Grid: Row-Level Validation At 10:34 2013-11-21, Richard Kaye rk...@invaluable.com wrote: In the beforerowcolchange method, do your row level validations. If that fails then use NODEFAULT to prevent the rowcol change. At least that's what the VFP

RE: Grid: Row-Level Validation

2013-11-22 Thread Ken Dibble
As long as we're getting all theoretical here, data validation should not be handled by the grid object. The grid should be able to call out to an object where you store your business rules. Then all your default control valid method code can be is something like

Re: Grid: Row-Level Validation

2013-11-22 Thread AndyHC
If you want to reduce clutter at least look at cursoradapters - they include GetFldState level info and lots more, and they offer a lot of advantages apart from helping with validation. There's plenty of stuff on them in Help! On 23/11/2013 01:42, Gene Wirchenko wrote: At 11:55 2013-11-21,

Re: Grid: Row-Level Validation

2013-11-22 Thread Fred Taylor
If I could work exclusively in VFP9, I'd have to agree cursor adapters would be the tool of choice. VFP7 didn't have them. I wish I could convince TPTB to use VFP9, but they'd rather spend the time (and money), re-writing in .NET. Fred On Fri, Nov 22, 2013 at 9:00 PM, AndyHC

Re: Grid: Row-Level Validation

2013-11-21 Thread Alan Bourke
On Wed, Nov 20, 2013, at 11:37 PM, Gene Wirchenko wrote: Dear Vixens and Reynards: I am also very puzzled that grids seem to be used a lot by others, and I have not read about this issue. They are widely used indeed - however I don't think many people implement direct row

Re: Grid: Row-Level Validation

2013-11-21 Thread Peter Cushing
Gene Wirchenko wrote: Dear Vixens and Reynards: I have been working on something else, and now, I come back to grids. I have asked this question before, but not gotten an answer that works. I am asking again just in case someone does know how to do this or even has a good lead.

Re: Grid: Row-Level Validation

2013-11-21 Thread Frank Cazabon
Gene, Sorry I sent this reply initially to your email address rather than the list by mistake. I've created a very simple example of some row validation. I have not gone through all your messages to see if I have fully understood what you are trying to do but maybe, using this as a

Re: Grid: Row-Level Validation

2013-11-21 Thread Gene Wirchenko
At 03:51 2013-11-21, Peter Cushing pcush...@whisperingsmith.com wrote: Gene Wirchenko wrote: Dear Vixens and Reynards: I have been working on something else, and now, I come back to grids. I have asked this question before, but not gotten an answer that works. I am asking again

Re: Grid: Row-Level Validation

2013-11-21 Thread Fred Taylor
Here's a sample that should show you how to do it. Just cut and paste into a .PRG and run it. Note the Form DataCheck method and the Grid.BeforeRowColChange code. Uses data buffering, GETFLDSTATE and OLDVAL. I tried to remove as much clutter as I could, so I hope you can at least follow it.

Re: Grid: Row-Level Validation

2013-11-20 Thread Fred Taylor
With the buffering, you can also look into the function GETFLDSTATE(). Mybad, CURVAL(), OLDVAL() is more useful detecting other users making changes to the record you're on. GETFLDSTATE returns a string representing the deleted status and the change/new status of each field. That in combination

Re: Grid: Row-Level Validation

2013-11-20 Thread Gene Wirchenko
At 15:46 2013-11-20, Fred Taylor fbtay...@gmail.com wrote: [snip] Or in the BeforeRowColChange, when the row changes, you can make a copy of the record you're on into an array property of the grid and then compare that with the control values in the AfterRowColChange when the row changes.

Re: Grid: Row-Level Validation

2013-11-20 Thread Sytze de Boer
Maybe you can try this Create a variable before you DO FORM (e.g. mcolnum) In the WHEN of the grid, number all the columns from 1 to whatever mclonum,=1, mcolnum=2 etc In the valid event, DO VALCOL Create a prg called VALCOL do case case mcolnum=1 whatever case mcolnum=2 whatever etc

Re: Grid: Row-Level Validation

2013-11-20 Thread Fred Taylor
Well, now you know why I'm not a big fan of using grids for data entry. Not worth the hassles. Other like it, I don't. Fred On Wed, Nov 20, 2013 at 5:04 PM, Gene Wirchenko ge...@telus.net wrote: At 15:46 2013-11-20, Fred Taylor fbtay...@gmail.com wrote: [snip] Or in the

Re: Grid: Row-Level Validation

2013-11-20 Thread Gene Wirchenko
At 16:39 2013-11-20, Fred Taylor fbtay...@gmail.com wrote: Well, now you know why I'm not a big fan of using grids for data entry. Not worth the hassles. Other like it, I don't. Well, I was hoping it would work for me. If I do get it working, I will be posting my

Re: Grid: Row-Level Validation

2013-11-20 Thread Gene Wirchenko
At 16:21 2013-11-20, Sytze de Boer sytze.k...@gmail.com wrote: Maybe you can try this Create a variable before you DO FORM (e.g. mcolnum) In the WHEN of the grid, number all the columns from 1 to whatever mclonum,=1, mcolnum=2 etc In the valid event, DO VALCOL Which valid event? I

Re: Grid: Row-Level Validation

2013-11-20 Thread Sytze de Boer
When you have a grid, you have a grid1.text1 with a valid method Example. In my invoicing grid I have a column with mcolnum=1 (This is where the client enters the QTY) If you look at the grid properties, for every column is a column(1,2,3,4,5), a header1 and a text1 The valid event is do valcol

Re: Grid: Row-Level Validation

2013-11-20 Thread Dan Covill
Gene, Thank you for the exhaustive and nicely-written enumeration of the reasons I NEVER enter data in a grid! The grid displays my data. Select a row and press Enter. A record view form pops up over the grid (you can still see where you are) and do your entry. In some cases we do