Just an observation to make it easier to assist: You need to learn to extract the details out of your code that is applicable:BiggyRat wrote:Code: Select all
METHOD UpdateButton( ) CLASS JobInfo LOCAL oTB as TextBox IF self:server:RLOCK(self:server:RECNO) self:server:Commit() // Why are you committing before you have done anything? self:oSFJobInfo_DETAIL:SingleLineEdit10 := ; ("$ " + AllTrim((Str(self:oSFJobInfo_DETAIL:RATE*self:oSFJobInfo_DETAIL:UNITS)))) if self:oSFJobInfo_DETAIL:CurrentView == #FormView self:oSFJobInfo_DETAIL:FIELDPUT(#RateType, AllTrim(self:oSFJobInfo_DETAIL:ComboBox1)) endif // self:oSFJobInfo_DETAIL: // self:oSFJobInfo_DETAIL:FIELDPUT(#JOBDATE, self:oSFJobInfo_DETAIL:JOBDATE) // self:oSFJobInfo_DETAIL:FIELDPUT(#JOBTIME, something.... ) self:oSFJobInfo_DETAIL:server:Commit() self:Browser:Refresh() self:oCCNewJobButton:Enable() ELSE oTB := TextBox{ self, cAppVersion,; "This record cannot be updated at present, as it is currently being accessed by another user" } oTB:Type := BUTTONOKAY + BOXICONASTERISK oTb:Show() ENDIF RETURN NIL
Code: Select all
METHOD Init(oWindow,iCtlID,oServer,uExtra) CLASS JobInfo_DETAIL
oDCDateTimePicker2 := DateTimePicker{SELF,ResourceID{JOBINFO_DETAIL_DATETIMEPICKER2,_GetInst()}}
oDCDateTimePicker2:HyperLabel := HyperLabel{#DateTimePicker2,"DateTimePicker2",NULL_STRING,NULL_STRING}
oDCDateTimePicker3 := DateTimePicker{SELF,ResourceID{JOBINFO_DETAIL_DATETIMEPICKER3,_GetInst()}}
oDCDateTimePicker3:HyperLabel := HyperLabel{#DateTimePicker3,NULL_STRING,NULL_STRING,NULL_STRING}
RETURN self
METHOD UpdateButton( ) CLASS JobInfo
IF self:server:RLOCK(self:server:RECNO)
self:server:Commit() // Why are you committing before you have done anything?
if self:oSFJobInfo_DETAIL:CurrentView == #FormView
self:oSFJobInfo_DETAIL:FIELDPUT(#RateType, AllTrim(self:oSFJobInfo_DETAIL:ComboBox1))
endif
// self:oSFJobInfo_DETAIL:
// self:oSFJobInfo_DETAIL:FIELDPUT(#JOBDATE, self:oSFJobInfo_DETAIL:JOBDATE)
// self:oSFJobInfo_DETAIL:FIELDPUT(#JOBTIME, something.... )
self:oSFJobInfo_DETAIL:server:Commit()
self:Browser:Refresh()
self:oCCNewJobButton:Enable()
ENDIF
RETURN NIL