Valid not firing from date field
Posted: Thu Apr 13, 2017 1:51 pm
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.
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.