PDA

View Full Version : Field validation stopping record save.



Terry
6-Sep-2005, 01:03 AM
Hi all,

I am playing around with a basic web application and having trouble
validating a fields data.



In the MAIN .DD I have the following. This works just fine with a VDF9.1( by
the way) application.

/////////////////////////////////////

// Daily.Mechanic

Set Field_Value_Table Field Daily.Mechanic To (Daily_Mechanic_VT(Self))

/////////////////////////////////////

In the web application I have a procedure

/////////////////////////////////////

Procedure Creating

Forward Send Creating
move "4" to daily.Mechanic


End_Procedure // Creating

/////////////////////////////////////

When I run it I get a error

Invalid Value
'Mechanic' field in 'Daily' datafile

The validation code table is set to allow 1 2 3 4 5 or 6 and like I said
works fine from with in a VDF91 program but not a Web application.



Any help much appreciated thanks.

Regards

Terry

Brisbane

Australia

Terry
6-Sep-2005, 01:26 AM
More info:
I just made another basic web entry form and manually entered data into the
field

daily.mechanic

and it entered as it should. Seems not to like forcing the data from this
procedure.

> Procedure Creating
>
> Forward Send Creating
> move "4" to daily.Mechanic
>
>
> End_Procedure // Creating

Regards
Terry
Brisbane
Australia

Steven Wong
6-Sep-2005, 03:05 AM
I think validation happens before creating.

You probably need to :

Procedure Field_Defaults
Set Field_Changed_Value Field Daily.Mechanic To "4"
End_Procedure // Field_Defaults

in the DD instead.

"Terry" <terryf@mrmechanic.com.au> wrote in message
news:lCO9GjqsFHA.1276@dacmail.dataaccess.com...
> Hi all,
>
> I am playing around with a basic web application and having trouble
> validating a fields data.
>
>
>
> In the MAIN .DD I have the following. This works just fine with a
VDF9.1( by
> the way) application.
>
> /////////////////////////////////////
>
> // Daily.Mechanic
>
> Set Field_Value_Table Field Daily.Mechanic To (Daily_Mechanic_VT(Self))
>
> /////////////////////////////////////
>
> In the web application I have a procedure
>
> /////////////////////////////////////
>
> Procedure Creating
>
> Forward Send Creating
> move "4" to daily.Mechanic
>
>
> End_Procedure // Creating
>
> /////////////////////////////////////
>
> When I run it I get a error
>
> Invalid Value
> 'Mechanic' field in 'Daily' datafile
>
> The validation code table is set to allow 1 2 3 4 5 or 6 and like I said
> works fine from with in a VDF91 program but not a Web application.
>
>
>
> Any help much appreciated thanks.
>
> Regards
>
> Terry
>
> Brisbane
>
> Australia
>
>
>

Terry
6-Sep-2005, 06:19 AM
Hi Steven,
Thanks for that. It has worked but I don't really want a default value for
other applications so may have to edit it in just for this use. Is there a
way to insert it into my web application instead of in the main DD or some
other way to include it only for this application?

Thanks again anyway Steven.

Regards
Terry


"Steven Wong" <steve@triumph-accounting.com> wrote in message
news:HzIQBnrsFHA.3716@dacmail.dataaccess.com...
> I think validation happens before creating.
>
> You probably need to :
>
> Procedure Field_Defaults
> Set Field_Changed_Value Field Daily.Mechanic To "4"
> End_Procedure // Field_Defaults
>
> in the DD instead.
>
> "Terry" <terryf@mrmechanic.com.au> wrote in message
> news:lCO9GjqsFHA.1276@dacmail.dataaccess.com...
> > Hi all,
> >
> > I am playing around with a basic web application and having trouble
> > validating a fields data.
> >
> >
> >
> > In the MAIN .DD I have the following. This works just fine with a
> VDF9.1( by
> > the way) application.
> >
> > /////////////////////////////////////
> >
> > // Daily.Mechanic
> >
> > Set Field_Value_Table Field Daily.Mechanic To (Daily_Mechanic_VT(Self))
> >
> > /////////////////////////////////////
> >
> > In the web application I have a procedure
> >
> > /////////////////////////////////////
> >
> > Procedure Creating
> >
> > Forward Send Creating
> > move "4" to daily.Mechanic
> >
> >
> > End_Procedure // Creating
> >
> > /////////////////////////////////////
> >
> > When I run it I get a error
> >
> > Invalid Value
> > 'Mechanic' field in 'Daily' datafile
> >
> > The validation code table is set to allow 1 2 3 4 5 or 6 and like I said
> > works fine from with in a VDF91 program but not a Web application.
> >
> >
> >
> > Any help much appreciated thanks.
> >
> > Regards
> >
> > Terry
> >
> > Brisbane
> >
> > Australia
> >
> >
> >
>
>

Larry Heiges
6-Sep-2005, 10:47 AM
Terry,

You could make the field_default a function and in the function use:

#IFDEF Is$WebApp

or a property you control to turn the default on/off


Larry Heiges
App-2-Win Systems, Inc.
LookFeel for Windows
http://app-2-win.com
LFW7sp3
LFW11

Ian Telfer
6-Sep-2005, 06:04 PM
Terry,

If you are using a validation table, you must either set a default
value, or turn the validation off (in the DD uncheck the validate flag),
no matter if it is a windows app or a WebApp.

Otherwise, why would they call it a validation table ;-)

Ian

Terry wrote:
> Hi all,
>
> I am playing around with a basic web application and having trouble
> validating a fields data.
>
>
>
> In the MAIN .DD I have the following. This works just fine with a VDF9.1( by
> the way) application.
>
> /////////////////////////////////////
>
> // Daily.Mechanic
>
> Set Field_Value_Table Field Daily.Mechanic To (Daily_Mechanic_VT(Self))
>
> /////////////////////////////////////
>
> In the web application I have a procedure
>
> /////////////////////////////////////
>
> Procedure Creating
>
> Forward Send Creating
> move "4" to daily.Mechanic
>
>
> End_Procedure // Creating
>
> /////////////////////////////////////
>
> When I run it I get a error
>
> Invalid Value
> 'Mechanic' field in 'Daily' datafile
>
> The validation code table is set to allow 1 2 3 4 5 or 6 and like I said
> works fine from with in a VDF91 program but not a Web application.
>
>
>
> Any help much appreciated thanks.
>
> Regards
>
> Terry
>
> Brisbane
>
> Australia
>
>
>

Steven Wong
6-Sep-2005, 08:35 PM
Like Larry says, if you put the function in the DD class then you could
control it with a property or #IFDEF. Otherwise just put it in the DD of the
wbo that needs it, it'll affect nothing except that wbo's operations.
Whatever's better for you.

"Terry" <terryf@mrmechanic.com.au> wrote in message
news:4Yw2MTtsFHA.960@dacmail.dataaccess.com...
> Hi Steven,
> Thanks for that. It has worked but I don't really want a default value for
> other applications so may have to edit it in just for this use. Is there a
> way to insert it into my web application instead of in the main DD or some
> other way to include it only for this application?
>
> Thanks again anyway Steven.
>
> Regards
> Terry
>
>
> "Steven Wong" <steve@triumph-accounting.com> wrote in message
> news:HzIQBnrsFHA.3716@dacmail.dataaccess.com...
> > I think validation happens before creating.
> >
> > You probably need to :
> >
> > Procedure Field_Defaults
> > Set Field_Changed_Value Field Daily.Mechanic To "4"
> > End_Procedure // Field_Defaults
> >
> > in the DD instead.
> >
> > "Terry" <terryf@mrmechanic.com.au> wrote in message
> > news:lCO9GjqsFHA.1276@dacmail.dataaccess.com...
> > > Hi all,
> > >
> > > I am playing around with a basic web application and having trouble
> > > validating a fields data.
> > >
> > >
> > >
> > > In the MAIN .DD I have the following. This works just fine with a
> > VDF9.1( by
> > > the way) application.
> > >
> > > /////////////////////////////////////
> > >
> > > // Daily.Mechanic
> > >
> > > Set Field_Value_Table Field Daily.Mechanic To
(Daily_Mechanic_VT(Self))
> > >
> > > /////////////////////////////////////
> > >
> > > In the web application I have a procedure
> > >
> > > /////////////////////////////////////
> > >
> > > Procedure Creating
> > >
> > > Forward Send Creating
> > > move "4" to daily.Mechanic
> > >
> > >
> > > End_Procedure // Creating
> > >
> > > /////////////////////////////////////
> > >
> > > When I run it I get a error
> > >
> > > Invalid Value
> > > 'Mechanic' field in 'Daily' datafile
> > >
> > > The validation code table is set to allow 1 2 3 4 5 or 6 and like I
said
> > > works fine from with in a VDF91 program but not a Web application.
> > >
> > >
> > >
> > > Any help much appreciated thanks.
> > >
> > > Regards
> > >
> > > Terry
> > >
> > > Brisbane
> > >
> > > Australia
> > >
> > >
> > >
> >
> >
>
>

Terry
7-Sep-2005, 04:25 PM
Thanks Larry and Steven,

I ended up putting it in the DD of the wbo like you suggested Steven and its
working great.

Thanks again,

Regards
Terry

"Steven Wong" <steve@triumph-accounting.com> wrote in message
news:9PEUMy0sFHA.632@dacmail.dataaccess.com...
> Like Larry says, if you put the function in the DD class then you could
> control it with a property or #IFDEF. Otherwise just put it in the DD of
the
> wbo that needs it, it'll affect nothing except that wbo's operations.
> Whatever's better for you.
>
> "Terry" <terryf@mrmechanic.com.au> wrote in message
> news:4Yw2MTtsFHA.960@dacmail.dataaccess.com...
> > Hi Steven,
> > Thanks for that. It has worked but I don't really want a default value
for
> > other applications so may have to edit it in just for this use. Is there
a
> > way to insert it into my web application instead of in the main DD or
some
> > other way to include it only for this application?
> >
> > Thanks again anyway Steven.
> >
> > Regards
> > Terry
> >
> >
> > "Steven Wong" <steve@triumph-accounting.com> wrote in message
> > news:HzIQBnrsFHA.3716@dacmail.dataaccess.com...
> > > I think validation happens before creating.
> > >
> > > You probably need to :
> > >
> > > Procedure Field_Defaults
> > > Set Field_Changed_Value Field Daily.Mechanic To "4"
> > > End_Procedure // Field_Defaults
> > >
> > > in the DD instead.
> > >
> > > "Terry" <terryf@mrmechanic.com.au> wrote in message
> > > news:lCO9GjqsFHA.1276@dacmail.dataaccess.com...
> > > > Hi all,
> > > >
> > > > I am playing around with a basic web application and having trouble
> > > > validating a fields data.
> > > >
> > > >
> > > >
> > > > In the MAIN .DD I have the following. This works just fine with a
> > > VDF9.1( by
> > > > the way) application.
> > > >
> > > > /////////////////////////////////////
> > > >
> > > > // Daily.Mechanic
> > > >
> > > > Set Field_Value_Table Field Daily.Mechanic To
> (Daily_Mechanic_VT(Self))
> > > >
> > > > /////////////////////////////////////
> > > >
> > > > In the web application I have a procedure
> > > >
> > > > /////////////////////////////////////
> > > >
> > > > Procedure Creating
> > > >
> > > > Forward Send Creating
> > > > move "4" to daily.Mechanic
> > > >
> > > >
> > > > End_Procedure // Creating
> > > >
> > > > /////////////////////////////////////
> > > >
> > > > When I run it I get a error
> > > >
> > > > Invalid Value
> > > > 'Mechanic' field in 'Daily' datafile
> > > >
> > > > The validation code table is set to allow 1 2 3 4 5 or 6 and like I
> said
> > > > works fine from with in a VDF91 program but not a Web application.
> > > >
> > > >
> > > >
> > > > Any help much appreciated thanks.
> > > >
> > > > Regards
> > > >
> > > > Terry
> > > >
> > > > Brisbane
> > > >
> > > > Australia
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>