Re: Entering dates in Forms 4.5
Date: 1997/06/10
Message-ID: <339DB1A6.53CA_at_asymetrix.com>#1/1
kda_at_sky.net wrote:
>
> We've recently converted our Forms 3.0 forms to Forms 4.5.
> One problem we've run across that irritates our users immensely.
>
> In Forms 3.0 a user could enter a date into a date field with the mask
> MM/DD/YY simply as MMDDYY and the form automatically inserted the '/'
> delimiter.
>
> But Forms 4.5 gives a VALUE ERROR when the users don't include the
> delimiter in the date.
>
> Is there someway in Forms 4.5 to have the delimiter automatically
> inserted that won't require making a change to a trigger?
>
> --
> ------------------------------------------------------------
> Kevin Agee Kevin.Agee.SysDev903A_at_igate.sprint.com
> ------------------------------------------------------------
Add the following 2 triggers to the date field:
PRE-TEXT-ITEM:
SET_FORM_PROPERTY('QE210',VALIDATION,PROPERTY_FALSE);
POST-TEXT-ITEM:
DECLARE
fix VARCHAR2(20);
BEGIN
fix:= NAME_IN('qemaster.calldte');
IF LENGTH(FIX) = 6 THEN
fix := SUBSTR(fix,1,2)||'/'|| SUBSTR(fix,3,2)||'/'|| SUBSTR(fix,5,2); --
-- The code below IS NOT YEAR 2000 compliant
-- :qemaster.calldte := TO_DATE(fix, SUBSTR(GET_ITEM_PROPERTY('qemaster.calldte',FORMAT_MASK),1,5)||'YY'); END IF; SET_FORM_PROPERTY('QE210',VALIDATION,PROPERTY_TRUE); EXCEPTION WHEN OTHERS THEN BELL; MESSAGE('Invalid date.'); RAISE FORM_TRIGGER_FAILURE; END; It's a hack, but it seems to work pretty well... Mike Madland mikemad_at_asymetrix.comReceived on Tue Jun 10 1997 - 00:00:00 CEST