Subject Re: Field validation in grid
From Milind Nighojkar <milinigh@yahoo.com>
Date Tue, 10 Aug 2021 12:02:21 -0400
Newsgroups dbase.getting-started

Thanks Akshat.


Akshat Kapoor Wrote:

> Good Morning Milind,
>
> > Scenerio:
> > I am in grid.
> > I want to validate a field say a date field D1. Validation is D1 > date() with error message when cursor is leaving field or record.
> > I want cursor to stay in filed till  feild value satisifies the validation condition
> >
> > Code is something like this
> > function editorControl_onLostFocus()
> >        local lRet
> >        lRet = false
> >        if this.value < date()
> >         lRet = false // Allow cancel
> >         this.validErrorMsg := "Past Date NOT allowed"
> >         else
> >         lRet = true
> >         endif
> > return lret
> >
> >
> > Any suggestion ?
> >
> > I used various ways usingevents like onlostfocus,valid for field
> > At row  level rowset_canEdit()
>
> Just to expand what Ken has already said.
>
> I have made it a principal not to allow editing in Grid.
>
> I have allowed editing in Grid in only 1 case and in that case also the
> table is a temp table from where data is inserted into main table AFTER
> validation.
>
> Regards
> Akshat
>