validationgenexusworkwithplus

Validate date range in a transaction


I got this transaction ZENSY0470M to insert data transaction and this web panel to insert (or update) information into the above transaction web layout rule (to receive parameter when update) pattern (using WWP ZENSY0470M WW (to show the data) Code from the Event Start to get data when updating Event when register Date validation code

I'm having trouble validating the date when trying to update a record For example If a record has the same key ZENSY0470M_SalOutCd7Plc = 1, ZENSY0470M_BseCd =1 and ZENSY0470M_EvntCd = 1


Solution

  • Maybe you should add in the 'ChkRegister' subroutine the part of the key (ZENSY0470M_TmpltId) that's missing to exclude from the search the record you're updating:

    For each ZENSY0470M
    where ZENSY0470M_SalOutCd7Plc = &ZENSY0470M_SalOutCd7Plc
    where ZENSY0470M_BseCd = &ZENSY0470M_BseCd
    where ZENSY0470M_EvntCd = &ZENSY0470M_EvntCd
    where ZENSY0470M_TmpltId <> &ZENSY0470M_TmpltId //Add this line
         If ZENSY0470M_AplyPrdFrm <= &ZENSY0470M_AplyPrdFrm and &ZENSY0470M_AplyPrdTo >= ZENSY0470M_AplyPrdTo
            MSG('1')
            &wErrFlg = Flg.On
         Else
            &wErrFlg = Flg.Off
         EndIf
         If ZENSY0470M_AplyPrdFrm <= ZENSY0470M_AplyPrdTo and &ZENSY0470M_AplyPrdTo >= ZENSY0470M_AplyPrdFrm 
            MSG('2')
            &wErrFlg = Flg.On
         Else
            &wErrFlg = Flg.Off
         EndIf
    EndFor