Valid not firing from date field

This forum is for eXpress++ general support.
Post Reply
Message
Author
Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Valid not firing from date field

#1 Post by Cliff Wiernik »

I have a program where the user enters in the date in the first code snippet and a part of the valid clause (called in the 2nd snippet) is that if the date changes, it populates another field with the user's initials. Sometimes, not too often (40 times out of say 50,000 items over 5 months), the valid appears to not be called and the user's initials are not populated into the 2nd field. I just found out that they are using the +/- features of the date field, pressing + twice to enter in the current date. Is there anyway that them doing this, which I was not even aware of, could be causing problems with the valid clause firing. I have now added a page level validation to detect the inconsistency and put them back in the field, but that is only a work around.

Any thoughts on why this could be happening. I am just in the process of checking their computer when this happens. They do not appear to be doing anything unusual or switching between other programs. At least the first several instances, the returning to the field and pressing enter the second time causes the valid to appear to be called, populating the user's initials field.


Code: Select all

  @ nRow, 77.5 DCSAY 'PW Review' GET m->dPaperrev       ;
                  PICTURE '@KD'                         ;
                  SAYLEFTBOTTOM                         ;
                  VALID {|oGet| S_pwrvinit(APPS->dPaperRev,m->dPaperRev,@m->cPaperInit,GetList) } ;
                  SAYSIZE 7.8                           ;
                  POPUP {|d| LB_Popdate(d)}             ;
                  POPCAPTION BITMAP_CALENDAR_LB POPHEIGHT 18 POPKEY xbeK_ALT_DOWN       ;
                  MESSAGE {|| LB_DataDICT('APPS','dPaperrev') }                         ;
                  EDITPROTECT {|| LB_EditProtect(d_lAddmode, aApp)}                     ;
                  GETCOLOR {|o| LB_GetColorArray(o,Getlist,d_lAddmode) }                ;
                  GETEVAL LB_FocusColorBlock()                                          ;
                  GETID 'DPAPERREV'                                                     ;
                  GETOBJECT d_oDpaperrev      

Code: Select all

*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
*+
*+    STATIC FUNCTION S_PWRVInit(dPWReview,dnew,cPaperInit,GetList)
*+
*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
*+
STATIC FUNCTION S_PWRVInit(dPWReview,dNew,cPaperInit, GetList)          // set paper work review initials if date added
  IF dPWReview # dNew .OR.                       ;
     (empty(cPaperInit) .AND. !empty(dNew)) .OR. ;  
     (!empty(cPaperInit) .AND. empty(dNew))                             // PC CAW 04-04-17 added check for empty initials
    IF empty(dNew)
      cPaperInit := SPACE(3)
    ELSE
      cPaperInit := m->oper_init
    ENDIF
    DC_GetRefresh(Getlist,'CPAPERINIT')
  ENDIF
  RETURN .T.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Valid not firing from date field

#2 Post by rdonnay »

A valid fires only when the object loses focus.
It has nothing to do with how the date value gets changed.
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Valid not firing from date field

#3 Post by Cliff Wiernik »

I am aware of that. Grasping at straws to determine why sometimes the valid is not firing. It should fire 100% of the time, not 99.9%. This was something I was not aware of the +/-. I know it is not leaving the field but was wondering if somehow it could be causing the non-firing of the valid.

Don't see how but was asking.

Post Reply