Code: Select all
Begincheck
Change Field(#VALID) To(0)
Change Field(#WKSTR30) To(#ADDRNM)
Execute Subroutine(CHK_STR) With_Parms(#WKSTR30 #VALID)
If Cond('#VALID > 0')
Set_Error For_Field(#ADDRNM) Msgid(ESO8797) Msgf(ESOMSGS)
Endif
EndcheckThanks!
Code: Select all
Begincheck
Change Field(#VALID) To(0)
Change Field(#WKSTR30) To(#ADDRNM)
Execute Subroutine(CHK_STR) With_Parms(#WKSTR30 #VALID)
If Cond('#VALID > 0')
Set_Error For_Field(#ADDRNM) Msgid(ESO8797) Msgf(ESOMSGS)
Endif
EndcheckCode: Select all
* ---------------------------------------------------------------------------------
Srvroutine Name(PutData) Session(*REQUIRED)
List_Map For(*INPUT) List(#EditableDataItems)
Field_Map For(*OUTPUT) Field(#ServerModuleResult)
Define_Com Class(#vf_elretc) Name(#Io_Status)
Define_Com Class(#Prim_dc.UnicodeString) Name(#ResultMessage)
* Invoke the server manager to set up the execution context for this server routine
#ServerSystemManager.InitializeServiceRoutine Persistentstring1(#Persistent_ApplicationString1) Persistentstring2(#Persistent_ApplicationString2) Persistentstring3(#Persistent_ApplicationString3) Persistentstring4(#Persistent_ApplicationString4) Persistentstring5(#Persistent_ApplicationString5) Event_Component(#COM_OWNER) Persistent_Eventdetails(#Persistent_EventDetails)
* Process the request
Get_Entry Number(1) From_List(#EditableDataItems)
Begincheck
Rangecheck Field(#SALARY) Range((50000 90000)) Msgtxt('The valid range for Salary is 50k to 150k in this program')
Endcheck If_Error(PER)
Goto Label(OK)
PER:
#IO_STATUS := VE
OK:
If (#IO_STATUS *NE VE)
Check_For In_File(PSLMST) With_Key(#XG_AccessKeys) Io_Status(#Io_Status) Io_Error(*NEXT)
Case (#Io_Status)
When (= EQ)
Update Fields(#EditableDataItems) In_File(PSLMST) With_Key(#XG_AccessKeys) Io_Status(#Io_Status) Io_Error(*NEXT)
When (= NE)
Insert Fields(#EditableDataItems) To_File(PSLMST) Io_Status(#Io_Status) Io_Error(*NEXT)
Endcase
Case (#Io_Status)
When (= OK)
#ResultMessage := *MTXTUF_MSG_0005.Substitute( #SingularName #Com_Self.VisibleIdentification )
#ServerModuleResult := True
When (= VE)
#ResultMessage := *MTXTUF_MSG_0006.Substitute( #SingularName #Com_Self.VisibleIdentification )
Otherwise
#ResultMessage := *MTXTUF_MSG_0007.Substitute( #SingularName #Com_Self.VisibleIdentification #Io_Status )
Endcase
Message Msgtxt(#ResultMessage)
Endif
* Invoke the server manager to clean up and finalize the execution context for this server routine
#ServerSystemManager.TerminateServiceRoutine Event_Component(#COM_OWNER)
Endroutine
Code: Select all
* ---------------------------------------------------------------------------------
Mthroutine Name(CheckClientSideValidation) Access(*PRIVATE)
Define_Map For(*INPUT) Class(#PRIM_ALPH) Name(#ForOperation)
Define_Map For(*RESULT) Class(#Prim_Boln) Name(#AllValid)
#COM_OWNER.avValidateAllTrackedMDControls Foroperation(#ForOperation) Allvalid(#AllValid)
* Add any additional client side validation logic here
Endroutine