Welcome! Log In Create A New Profile

Advanced

WD11 + mandatory input

Posted by Jan de Bruin 
Jan de Bruin
WD11 + mandatory input
May 23, 2008 01:09PM
Hi

How can i test with a property when a entry is mandatory ?? :angry:

TIA !!!!!!!!!!!!
jan
Ricardo
Validate field entry
May 24, 2008 06:05AM

I don't know if it is possible to test the property mandatory but you can validate field entry, see code bellow

Quick example of how to keep a User on a field if an entry is required.

My example field is ACCT_NO
Open up the code for ACCT_NO (or whatever) and at the "Exit of ACCT_NO" section enter.
---------------------------------
IF ACCT_NO = 0 AND NextField()<>ACCT_NO THEN
Info("Account Number is required"+CR+" Please enter or ""Cancel"" adding a ""New"" record.")
ReturnToCapture(ACCT_NO)
END

---------------------------------
IF ACCT_NO = 0 THEN
Info("Account Number is required"+CR+" Please enter or ""Cancel"" adding a ""New"" record.")
ReturnToCapture(ACCT_NO)
END

or

IF INPUT = "" AND NextField() <> INPUT THEN
Info("message")
ReturnToCapture( IMPUT )
END

Carlo Hermus
Re: Validate field entry
May 24, 2008 12:04PM
Hi Jan,

I don't know how to do it either, but I use my own validation.

I create a group called GR_Validate and add all controls that needs to be validated.

Then in the ok/save button I add my code

i is int = 1
bValidateOK is boolean = True
ResControl is string

ResControl = EnumControl(GR_Validate, i)
WHILE ResControl<>""
	i++
	IF {ResControl}..Value = "" THEN
		bValidateOK = False
		MyFont is Font
		MyFont = FontCreate("Tahoma", 8, iBold, iDarkRed)
		{ResControl}..BrushColor = LightRed
	END
	ResControl = EnumControl(GR_Validate, i)
END

IF bValidateOK THEN
	Do stuff..
ELSE
	NextTitle("Shared TimeSheet")
	Info("A.u.b. alle benodigde velden invullen.")
END
GuenterP
Re: Validate field entry
May 24, 2008 01:15PM
Hi Carlo, in RAD-generated Forms, the RADSave() procedure is the right place for validation. Btw, good old RAD is still there in WD12, together with that good old bug in the OK-button code. It's more or less the last one in RAD Form with browse. Kind regards, Guenter
Glenn Rathke
Re: Validate field entry
May 24, 2008 02:34PM
Guenter,

You mention the good old rad is still there. How about the new rad, is it radically different?

Thanks
Glenn
GuenterP
Re: Validate field entry
May 24, 2008 04:07PM
Hi Glenn, new RAD is radically different because the burden of making and maintaining the templates is handed over to the user ;-) (except for the two example templates) It offers a rich user interface, too many gimmicks for my taste. Maybe just right for some smaller application. Hadn't much time to explore it since the English beta versions came up dozens of with duplicate declarations after a generation run and for experiments one would have to design one's own set of templates. Kind regards, Guenter
Carlo Hermus
Re: Validate field entry
May 24, 2008 10:43PM
Quote
GuenterP
Hi Carlo, in RAD-generated Forms, the RADSave() procedure is the right place for validation. Btw, good old RAD is still there in WD12, together with that good old bug in the OK-button code. It's more or less the last one in RAD Form with browse. Kind regards, Guenter

Guenter,

I know I istill have to create classes and procedures for this app. But it is still in Beta mode. ;-)

BTW, what bug in the ok button? I am not using the RAD at the moment, I want to change the whole class first, before using it.
Jan de Bruin
Re: Validate field entry
May 27, 2008 09:53AM
Hi Carlo

Thanks for this tip. Making a group is a good solution...
Still i think PCSOFT has to make a property to test the mandatory input...

TIA
Jan
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: