[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

749.0. "Entry form load integer date only on create" by MISFIT::KINNEYD (Angst for the memories) Fri May 22 1992 21:06

    I have an entry form with a typical integer fms type date field called
    proj_start_fore. I want todays date loaded into the field only on a
    create operation, when oa$entry_form_mode =1. All other times, like
    edit functions I want this date left alone.
    
    I have the current named data on the entry form:
    
    ENTRY/MODE=UPDATE/HARD='WHITE SHEET MANAGEMENT SYSTEM'
    /PRE='IF OA$ENTRY_FORM_MODE EQS "1" THEN GET PROJ_START_FORE =
     OA$DATE:2 OA$DATE:2:3 OA$DATE:2:6'
    
    The first time through a create, where the current item block is blank
    I get nothing loaded into the date field. The next time through, where
    there is data in the cib, I get the date loaded correctly.
    
    Two questions:
    
    Whats happening here?
    
    and
    
    Isn't there a better way to get oa$date formatted right?
    
    Dave Kinney
    
T.RTitleUserPersonal
Name
DateLines
749.1Try using the /BLANK qualifer + /GETSHALOT::WARFORDRichard Warford @OPA DTN 393-7495Fri May 22 1992 23:5612
    How about:
    
    	;;PROJ_START_FORE;;
    
    /GET=OA$DATE_NBS::2/BLANK
    
    OR 
    
    /GET=OA$DATE:2 OA$DATE:2:3 OA$DATE:2:6/BLANK
    
    Rick
    
749.2I think that is only with an alpha fieldMISFIT::KINNEYDAngst for the memoriesTue May 26 1992 15:415
    Thanks for the reply. The date field is defined as 99/99/99 and
    naturally the default value is zeros. the system does not see this as
    blank, as far as I can tell.
    
    Dave Kinney
749.3Another ideaHOTAIR::MADDOXWhen in doubt, change itTue May 26 1992 18:5718
>    I have the current named data on the entry form:
>    
>    ENTRY/MODE=UPDATE/HARD='WHITE SHEET MANAGEMENT SYSTEM'
>    /PRE='IF OA$ENTRY_FORM_MODE EQS "1" THEN GET PROJ_START_FORE =
>     OA$DATE:2 OA$DATE:2:3 OA$DATE:2:6'


Do you mean, '.IF OA$ENTRY_FORM_MODE...'?  Notice the period.

If this doesn't fix it, try:

     ENTRY/MODE=UPDATE/HARD='WHITE SHEET MANAGEMENT SYSTEM'
    /PRE='.IF PROJ_START_FORE lt 1 THEN GET PROJ_START_FORE =
     OA$DATE:2 OA$DATE:2:3 OA$DATE:2:6'

Pleasant coding,

Joe
749.4Great job Tim and Cathy!!MISFIT::KINNEYDAngst for the memoriesWed May 27 1992 14:5317
    Interesting thing about this is that when you call an entry
    form/mode=add and the form is painted leaving you on the key field and 
    you test entry_form_mode at this point, before the key is entered, it
    is equal 0. After the key is entered and you hit a return, then the
    mode is evaluated and is changed to 1. Therefore, if you test for it, you
    have to do it on the next non key field as say a pre function, not as a
    form pre function under type
    
    I guess I would had hoped/assumed that the mode would be evaluated on the 
    form call since I am being specific about the mode right in the syntax or 
    at least some time prior to the pre functions being evaluated.
    
    So thanks to Cathy and Tim at Atlanta, we put the if as a pre function
    on the next field, a get_save on the date field, and a get on the
    Create call from the menu. 
    
    Dave Kinney
749.5Makes senseSHALOT::NICODEMWho told you I'm paranoid???Wed May 27 1992 21:1013
	Although I haven't tested this, I would suspect that if you called the
entry form with a /SAVE_START, and specified the key of the record, then your
/PRE would have worked.  You have to remember that invoking an entry form with
the FORM function causes the entry form to be processed twice -- once to get the
key, and once to process the entire record.  Since there is already some special
processing done on that first pass (such as a /FIELD=keyfield, so that only the
key field is processed), I would not be surprised that there are other unusual
things going on as well.  Also, keep in mind that the mode of the form is not
determined until *between* the two passes -- that is, *after* it has gotten the
key, and *before* it processes the entire record.  (To verify this, call the
form in UPDATE mode, and note when you are prompted for the mode...)

	F
749.6It does make sense, but...HOTAIR::MADDOXWhen in doubt, change itThu May 28 1992 18:5823
Frank,

When you realize that an entry form is processed twice the behavior does
make sense.  I would argue though, that since the first pass is only to
get the key, the /PRE form qualifier should not be dispached until the
second pass.  If someone wanted a /PRE invoked during the first pass, he
could make it a /PRE field qualifier on the key field.

The problem with puting a /PRE field qualifier on some other field is that
it's possible that field is not always included in the /FIELD list when
the form is called.

Others might of course think this would be unatural behavior, and it's 
probably impossible to change the behavior at this point without breaking
lots of existing applications.

Perhaps, as a wish, we could have a /PRE_KEY form qualifier and a
/POST_KEY form qualifier.  (The /PRE_KEY would of course not be necessary
since it would behave the same way as a /PRE form qualifier does now.)

Just a thought,

Joe