fbpx
Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1
  • 2

TOPIC: Hopefully last question for a while.

Hopefully last question for a while. 4 months 4 weeks ago #8469

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 206
I have a date/time picker set to time format. When I set the time eg 10:25:44 PM, on writing it back to the database, it drops back to AM.
The rest of it is stored correctly. My obvious question is WHY?

I've done the setAM/PM thing, made sure the field is long enough and (I think the right type - character) etc

Any ideas please?

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 4 weeks ago #8470

  Chris's Avatar Chris Offline Posts: 1335
Please provide more information, is it the VOGUI, WinForms or WPF date control?
What database, DataTable/SQL or simple DBF?
Can you please show some code, how you are loading and saving the value?
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 4 weeks ago #8471

  Chris's Avatar Chris Offline Posts: 1335
Ah sorry, just now made the connection, just saw your question also in the VO newsgroup!
So apparently you are using VOGUI and DBF in VO, please do post the code you are using to load and save the value though.
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

Last edit: by Chris.

Hopefully last question for a while. 4 months 4 weeks ago #8474

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 206
Hi Chris,
I think the problem lies in not being able to access the value returned by the time and also a date picker control. Basically, this is it:

I have a screen called "JobInfo" it's a relational set up (Client info from DBServer Client DBF in Master, JobInfo) and a Date Picker and Time Picker (2 separate controls) In the SUBFORM of JobInfo, called JobInfo_Details which contains the details of the actual job number for that particular client in a many-to-one relationshio. (Many Jobs (subform) to one Client Code (main form)

The problem is this code in the "UPDATE" Button in the main screen, JobInfo says that bothe DateTimePicker1 and DateTimePicker2 are out of scope or can't be found. I can't see any way to access the selected Date and Time.

I've crawled over every forum, user guide, help files etc but with help like

DateTimePicker:SelectedTime Access/Assign
Description

A string (format "HH:MM:SS") specifying the currently selected time."


and

DateTimePicker:SelectedDate Access/Assign
Description

A date specifying the currently selected date.


From the actual VO "help" file (I'm using the term "help" VERY loosely here) I can't seem to access the required info.

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 4 weeks ago #8476

  lumberjack's Avatar lumberjack Offline Posts: 543
Hi Jeff,

BiggyRat wrote: I think the problem lies in not being able to access the value returned by the time and also a date picker control. Basically, this is it:
I have a screen called "JobInfo" it's a relational set up (Client info from DBServer Client DBF in Master, JobInfo) and a Date Picker and Time Picker (2 separate controls) In the SUBFORM of JobInfo, called JobInfo_Details which contains the details of the actual job number for that particular client in a many-to-one relationshio. (Many Jobs (subform) to one Client Code (main form)
The problem is this code in the "UPDATE" Button in the main screen, JobInfo says that both the DateTimePicker1 and DateTimePicker2 are out of scope or can't be found. I can't see any way to access the selected Date and Time.

I think you actually describing your problem yourself here, but without code it is not that easy to assist. I will try and explain from my understanding...
CLASS JobInfo
  PROTECT oJobDetail AS JobDetail
  METHOD dtPickerAccess()
    SELF:DateTimePicker1:SelectedTime  // Out of scope, can't be found
    SELF:DateTimePicker2:SelectedTime  // Out of scope, can't be found
    SELF:oJobDetail:DateTimePicker1:SelectedTime  //  This will be in scope and found
    SELF:oJobDetail:DateTimePicker2:SelectedTime  // This will be in scope and found
  RETURN
END CLASS
CLASS JobDetail
  EXPORT DateTimePicker1, DateTimePicker2 AS DateTimePicker
END CLASS
You will have to show us the code of how this Window was actually created...
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Last edit: by lumberjack. Reason: Forgot oJobDetail in one line

Hopefully last question for a while. 4 months 4 weeks ago #8477

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 206
Hi Johan, thanks for the information, I hope this enough for you to go on...
METHOD Init(oWindow,iCtlID,oServer,uExtra) CLASS JobInfo_DETAIL 
LOCAL olServer AS OBJECT
LOCAL DIM aFonts[3] AS OBJECT
LOCAL DIM aBrushes[3] AS OBJECT

self:PreInit(oWindow,iCtlID,oServer,uExtra)

SUPER:Init(oWindow,ResourceID{"JobInfo_DETAIL",_GetInst()},iCtlID)

aFonts[1] := Font{,10,"Microsoft Sans Serif"}
aFonts[1]:Bold := TRUE
aFonts[2] := Font{,10,"Microsoft Sans Serif"}
aFonts[3] := Font{,11,"Microsoft Sans Serif"}
aFonts[3]:Bold := TRUE
aBrushes[1] := Brush{Color{COLORYELLOW}}
aBrushes[2] := Brush{Color{COLORBLACK}}
aBrushes[3] := Brush{Color{239,239,239}}

oDCJOBNUMBER := SingleLineEdit{SELF,ResourceID{JOBINFO_DETAIL_JOBNUMBER,_GetInst()}}
oDCJOBNUMBER:FieldSpec := DETAILS_JOBNUMBER{}
oDCJOBNUMBER:HyperLabel := HyperLabel{#JOBNUMBER,"Job Number:",NULL_STRING,"DETAILS_JOBNUMBER"}
oDCJOBNUMBER:TextColor := Color{COLORRED}
oDCJOBNUMBER:BackGround := aBrushes[1]
oDCJOBNUMBER:Font(aFonts[1], FALSE)

oDCJOBFIN := CheckBox{SELF,ResourceID{JOBINFO_DETAIL_JOBFIN,_GetInst()}}
oDCJOBFIN:HyperLabel := HyperLabel{#JOBFIN,"Complete?",NULL_STRING,"DETAILS_JOBFIN"}
oDCJOBFIN:FieldSpec := DETAILS_JOBFIN{}
oDCJOBFIN:Font(aFonts[2], FALSE)

oDCPONumber := SingleLineEdit{SELF,ResourceID{JOBINFO_DETAIL_PONUMBER,_GetInst()}}
oDCPONumber:HyperLabel := HyperLabel{#PONumber,"PO Number",NULL_STRING,NULL_STRING}
oDCPONumber:FieldSpec := DETAILS_PONUMBER{}
oDCPONumber:Font(aFonts[2], FALSE)

oDCRATE := SingleLineEdit{SELF,ResourceID{JOBINFO_DETAIL_RATE,_GetInst()}}
oDCRATE:FieldSpec := DETAILS_RATE{}
oDCRATE:HyperLabel := HyperLabel{#RATE,"Rate/Price",NULL_STRING,NULL_STRING}
oDCRATE:Font(aFonts[2], FALSE)

oDCUNITS := SingleLineEdit{SELF,ResourceID{JOBINFO_DETAIL_UNITS,_GetInst()}}
oDCUNITS:HyperLabel := HyperLabel{#UNITS,"Units",NULL_STRING,NULL_STRING}
oDCUNITS:FieldSpec := DETAILS_UNITS{}
oDCUNITS:Font(aFonts[2], FALSE)

oDCComboBox1 := combobox{SELF,ResourceID{JOBINFO_DETAIL_COMBOBOX1,_GetInst()}}
olServer := RATES{}
oDCComboBox1:FillUsing(olServer,#RATETYPE,#RATETYPE)
olServer:Close()
oDCComboBox1:HyperLabel := HyperLabel{#ComboBox1,NULL_STRING,NULL_STRING,NULL_STRING}
oDCComboBox1:FieldSpec := DETAILS_RATETYPE{}
oDCComboBox1:Font(aFonts[2], FALSE)

oDCRego := SingleLineEdit{SELF,ResourceID{JOBINFO_DETAIL_REGO,_GetInst()}}
oDCRego:HyperLabel := HyperLabel{#Rego,"Registration",NULL_STRING,NULL_STRING}
oDCRego:Font(aFonts[2], FALSE)

oDCSubby := SingleLineEdit{SELF,ResourceID{JOBINFO_DETAIL_SUBBY,_GetInst()}}
oDCSubby:FieldSpec := DETAILS_SUBBY{}
oDCSubby:HyperLabel := HyperLabel{#Subby,"Subcontractor",NULL_STRING,NULL_STRING}
oDCSubby:Font(aFonts[2], FALSE)

oDCJOBDETAILS := MultiLineEdit{SELF,ResourceID{JOBINFO_DETAIL_JOBDETAILS,_GetInst()}}
oDCJOBDETAILS:FieldSpec := DETAILS_JOBDETAILS{}
oDCJOBDETAILS:HyperLabel := HyperLabel{#JOBDETAILS,"Job Details",NULL_STRING,"DETAILS_JOBDETAILS"}
oDCJOBDETAILS:Font(aFonts[2], FALSE)

oDCNPC := MultiLineEdit{SELF,ResourceID{JOBINFO_DETAIL_NPC,_GetInst()}}
oDCNPC:HyperLabel := HyperLabel{#NPC,"Non Printing Comments","Text placed in this field DOES NOT appear on any standard report. It can however be used in a custom report.","Text placed in this field DOES NOT appear on any standard report. It can however be used in a custom report."}
oDCNPC:FieldSpec := DETAILS_NPC{}
oDCNPC:UseHLforToolTip := True
oDCNPC:Font(aFonts[2], FALSE)

oDCSC_JOBDATE := FixedText{SELF,ResourceID{JOBINFO_DETAIL_SC_JOBDATE,_GetInst()}}
oDCSC_JOBDATE:HyperLabel := HyperLabel{#SC_JOBDATE,"Job Date:",NULL_STRING,NULL_STRING}
oDCSC_JOBDATE:Font(aFonts[2], FALSE)

oDCSC_JOBTIME := FixedText{SELF,ResourceID{JOBINFO_DETAIL_SC_JOBTIME,_GetInst()}}
oDCSC_JOBTIME:HyperLabel := HyperLabel{#SC_JOBTIME,"Job Time:",NULL_STRING,NULL_STRING}
oDCSC_JOBTIME:Font(aFonts[2], FALSE)

oDCGroupBox1 := GroupBox{SELF,ResourceID{JOBINFO_DETAIL_GROUPBOX1,_GetInst()}}
oDCGroupBox1:HyperLabel := HyperLabel{#GroupBox1," Job Details ",NULL_STRING,NULL_STRING}
oDCGroupBox1:Font(aFonts[1], FALSE)

oDCSC_JOBNUMBER := FixedText{SELF,ResourceID{JOBINFO_DETAIL_SC_JOBNUMBER,_GetInst()}}
oDCSC_JOBNUMBER:HyperLabel := HyperLabel{#SC_JOBNUMBER,"Job Number:",NULL_STRING,NULL_STRING}
oDCSC_JOBNUMBER:Font(aFonts[2], FALSE)

oDCFixedText4 := FixedText{SELF,ResourceID{JOBINFO_DETAIL_FIXEDTEXT4,_GetInst()}}
oDCFixedText4:HyperLabel := HyperLabel{#FixedText4,"Customer PO:",NULL_STRING,NULL_STRING}
oDCFixedText4:Font(aFonts[2], FALSE)

oDCFixedText5 := FixedText{SELF,ResourceID{JOBINFO_DETAIL_FIXEDTEXT5,_GetInst()}}
oDCFixedText5:HyperLabel := HyperLabel{#FixedText5,"Quoted Price: $",NULL_STRING,NULL_STRING}
oDCFixedText5:Font(aFonts[2], FALSE)

oDCFixedText6 := FixedText{SELF,ResourceID{JOBINFO_DETAIL_FIXEDTEXT6,_GetInst()}}
oDCFixedText6:HyperLabel := HyperLabel{#FixedText6,"Per Rate Type:",NULL_STRING,NULL_STRING}
oDCFixedText6:Font(aFonts[2], FALSE)

oDCFixedText7 := FixedText{SELF,ResourceID{JOBINFO_DETAIL_FIXEDTEXT7,_GetInst()}}
oDCFixedText7:HyperLabel := HyperLabel{#FixedText7,"Registration:",NULL_STRING,NULL_STRING}
oDCFixedText7:Font(aFonts[2], FALSE)

oDCFixedText8 := FixedText{SELF,ResourceID{JOBINFO_DETAIL_FIXEDTEXT8,_GetInst()}}
oDCFixedText8:HyperLabel := HyperLabel{#FixedText8,"Subcontractor:",NULL_STRING,NULL_STRING}
oDCFixedText8:Font(aFonts[2], FALSE)

oDCGroupBox2 := GroupBox{SELF,ResourceID{JOBINFO_DETAIL_GROUPBOX2,_GetInst()}}
oDCGroupBox2:HyperLabel := HyperLabel{#GroupBox2," Non-Printing Comments ",NULL_STRING,NULL_STRING}
oDCGroupBox2:Font(aFonts[1], FALSE)

oDCFixedText9 := FixedText{SELF,ResourceID{JOBINFO_DETAIL_FIXEDTEXT9,_GetInst()}}
oDCFixedText9:HyperLabel := HyperLabel{#FixedText9,"Invoice Total:",NULL_STRING,NULL_STRING}
oDCFixedText9:Font(aFonts[2], FALSE)

oDCFixedText11 := FixedText{SELF,ResourceID{JOBINFO_DETAIL_FIXEDTEXT11,_GetInst()}}
oDCFixedText11:HyperLabel := HyperLabel{#FixedText11,"Units:",NULL_STRING,NULL_STRING}
oDCFixedText11:Font(aFonts[2], FALSE)

oDCSingleLineEdit10 := SingleLineEdit{SELF,ResourceID{JOBINFO_DETAIL_SINGLELINEEDIT10,_GetInst()}}
oDCSingleLineEdit10:HyperLabel := HyperLabel{#SingleLineEdit10,NULL_STRING,NULL_STRING,NULL_STRING}
oDCSingleLineEdit10:TextColor := Color{COLORYELLOW}
oDCSingleLineEdit10:BackGround := aBrushes[2]
oDCSingleLineEdit10:Font(aFonts[1], FALSE)

oDCSLEInvtxt := FixedText{SELF,ResourceID{JOBINFO_DETAIL_SLEINVTXT,_GetInst()}}
oDCSLEInvtxt:HyperLabel := HyperLabel{#SLEInvtxt,NULL_STRING,NULL_STRING,NULL_STRING}
oDCSLEInvtxt:BackGround := aBrushes[3]
oDCSLEInvtxt:TextColor := Color{255,0,0}
oDCSLEInvtxt:Font(aFonts[3], FALSE)

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}

SELF:Caption := ""
SELF:HyperLabel := HyperLabel{#JobInfo_DETAIL,NULL_STRING,NULL_STRING,NULL_STRING}
SELF:Menu := StandardShellMenu{}

if !IsNil(oServer)
	SELF:Use(oServer)
ELSE
	SELF:Use(DETAILS{})
ENDIF
self:Browser := DataBrowser{self}

oDBJOBNUMBER := DataColumn{DETAILS_JOBNUMBER{}}
oDBJOBNUMBER:Width := 11
oDBJOBNUMBER:HyperLabel := oDCJOBNUMBER:HyperLabel 
oDBJOBNUMBER:Caption := "Job Number:"
oDBJOBNUMBER:TextColor := Color{COLORRED}
oDBJOBNUMBER:BackGround := aBrushes[1]
self:Browser:AddColumn(oDBJOBNUMBER)

oDBCLCODE := DataColumn{DETAILS_CLCODE{}}
oDBCLCODE:Width := 12
oDBCLCODE:HyperLabel := HyperLabel{#CLCODE,"Code",NULL_STRING,"DETAILS_CLCODE"} 
oDBCLCODE:Caption := "Code"
self:Browser:AddColumn(oDBCLCODE)

oDBJOBDATE := DataColumn{DETAILS_JOBDATE{}}
oDBJOBDATE:Width := 8
oDBJOBDATE:HyperLabel := HyperLabel{#JobDate,"Date",NULL_STRING,NULL_STRING} 
oDBJOBDATE:Caption := "Date"
self:Browser:AddColumn(oDBJOBDATE)

oDBJOBTIME := DataColumn{DETAILS_JOBTIME{}}
oDBJOBTIME:Width := 8
oDBJOBTIME:HyperLabel := HyperLabel{#JobTime,"Time",NULL_STRING,NULL_STRING} 
oDBJOBTIME:Caption := "Time"
self:Browser:AddColumn(oDBJOBTIME)

oDBDNAME := DataColumn{DETAILS_DNAME{}}
oDBDNAME:Width := 17
oDBDNAME:HyperLabel := HyperLabel{#DNAME,"Driver",NULL_STRING,NULL_STRING} 
oDBDNAME:Caption := "Driver"
self:Browser:AddColumn(oDBDNAME)

oDBJOBDETAILS := DataColumn{DETAILS_JOBDETAILS{}}
oDBJOBDETAILS:Width := 38
oDBJOBDETAILS:HyperLabel := oDCJOBDETAILS:HyperLabel 
oDBJOBDETAILS:Caption := "Job Details"
self:Browser:AddColumn(oDBJOBDETAILS)

oDBPONUMBER := DataColumn{DETAILS_PONUMBER{}}
oDBPONUMBER:Width := 18
oDBPONUMBER:HyperLabel := oDCPONUMBER:HyperLabel 
oDBPONUMBER:Caption := "PO Number"
self:Browser:AddColumn(oDBPONUMBER)

oDBRATE := DataColumn{DETAILS_RATE{}}
oDBRATE:Width := 11
oDBRATE:HyperLabel := oDCRATE:HyperLabel 
oDBRATE:Caption := "Rate/Price"
self:Browser:AddColumn(oDBRATE)

oDBRATETYPE := DataColumn{DETAILS_RATETYPE{}}
oDBRATETYPE:Width := 12
oDBRATETYPE:HyperLabel := HyperLabel{#RATETYPE,"Rate Type",NULL_STRING,NULL_STRING} 
oDBRATETYPE:Caption := "Rate Type"
self:Browser:AddColumn(oDBRATETYPE)

oDBUNITS := DataColumn{DETAILS_UNITS{}}
oDBUNITS:Width := 9
oDBUNITS:HyperLabel := oDCUNITS:HyperLabel 
oDBUNITS:Caption := "Units"
self:Browser:AddColumn(oDBUNITS)

oDBSUBBY := DataColumn{DETAILS_SUBBY{}}
oDBSUBBY:Width := 34
oDBSUBBY:HyperLabel := oDCSUBBY:HyperLabel 
oDBSUBBY:Caption := "Subcontractor"
self:Browser:AddColumn(oDBSUBBY)

oDBREGO := DataColumn{24}
oDBREGO:Width := 24
oDBREGO:HyperLabel := oDCREGO:HyperLabel 
oDBREGO:Caption := "Registration"
self:Browser:AddColumn(oDBREGO)

oDBNPC := DataColumn{DETAILS_NPC{}}
oDBNPC:Width := 44
oDBNPC:HyperLabel := oDCNPC:HyperLabel 
oDBNPC:Caption := "Non Printing Comments"
self:Browser:AddColumn(oDBNPC)

oDBJOBFIN := DataColumn{DETAILS_JOBFIN{}}
oDBJOBFIN:Width := 7
oDBJOBFIN:HyperLabel := oDCJOBFIN:HyperLabel 
oDBJOBFIN:Caption := "Complete?"
self:Browser:AddColumn(oDBJOBFIN)

oDBINVOICED := DataColumn{DETAILS_INVOICED{}}
oDBINVOICED:Width := 9
oDBINVOICED:HyperLabel := HyperLabel{#INVOICED,"Inv",NULL_STRING,NULL_STRING} 
oDBINVOICED:Caption := "Inv"
self:Browser:AddColumn(oDBINVOICED)


SELF:ViewAs(#FormView)

self:PostInit(oWindow,iCtlID,oServer,uExtra)

return self

Please Log in or Create an account to join the conversation.

Last edit: by robert.

Hopefully last question for a while. 4 months 4 weeks ago #8492

  lumberjack's Avatar lumberjack Offline Posts: 543
Hi Jeff,

BiggyRat wrote: Hi Johan, thanks for the information, I hope this enough for you to go on...

Well almost...
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
I was looking for this portion of your code. However, I don't see the button press event code that causes all the magic troubles...
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Last edit: by lumberjack.

Hopefully last question for a while. 4 months 4 weeks ago #8496

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 206
Sorry, here it is Johan:
METHOD UpdateButton( ) CLASS JobInfo
	
LOCAL oTB as TextBox

IF self:server:RLOCK(self:server:RECNO)
	self:server:Commit()
	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

Please Log in or Create an account to join the conversation.

Last edit: by robert.

Hopefully last question for a while. 4 months 4 weeks ago #8497

  FFF's Avatar FFF Away Posts: 680
Jeff,
"self:oSFJobInfo_DETAIL:FIELDPUT(#RateType, AllTrim(self:oSFJobInfo_DETAIL:ComboBox1))"
What should the Alltrim return?
Karl
Regards
Karl

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 4 weeks ago #8498

  robert's Avatar robert Offline Posts: 1156
Jeff,

IF self:server:RLOCK(self:server:RECNO)
self:server:Commit()

You are not writing anything to the server, so why bother locking and committing ?
And then later
self:oSFJobInfo_DETAIL:FIELDPUT(#RateType, AllTrim(self:oSFJobInfo_DETAIL:ComboBox1))
self:oSFJobInfo_DETAIL:server:Commit()

You did not lock self:oSFJobInfo_DETAIL:server

Why use manual locking on one server and not on the other ?

Robert
XSharp Development Team
The Netherlands

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 4 weeks ago #8499

  lumberjack's Avatar lumberjack Offline Posts: 543
Hi Jeff,

BiggyRat wrote:

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

Just an observation to make it easier to assist: You need to learn to extract the details out of your code that is applicable:
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
Hope you understand... It makes it so much easier to assist and save all of us the frustration to try and unravel what you doing...
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 4 weeks ago #8509

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 206
Well not really Johan... I have always believed (and was taught) it's better to give too much information than not enough. My concern is that if I leave out something, it could actually be the cause of my problem that is missing.

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 4 weeks ago #8511

  FFF's Avatar FFF Away Posts: 680
Johan,
that's one of the reasons, why i was taught to put any "designer" generated into it's own mef - or prg these days ;)- and inherit in another file where all hand coding goes. Much easier to see what's what...

Karl
Regards
Karl

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 4 weeks ago #8522

  lumberjack's Avatar lumberjack Offline Posts: 543
Karl,

FFF wrote: that's one of the reasons, why i was taught to put any "designer" generated into it's own mef - or prg these days ;)- and inherit in another file where all hand coding goes. Much easier to see what's what...

It sounds like I was your mentor, I used that approach since early days of VO...
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 4 weeks ago #8525

  FFF's Avatar FFF Away Posts: 680
;)- nope, it was the late Thomas Frey. Back in IIRC '94, first shy steps in 1.0beta...
Regards
Karl

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 3 weeks ago #8527

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 206
umm, bot please?

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 3 weeks ago #8528

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 206
umm, back on topic please?

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 3 weeks ago #8530

  FFF's Avatar FFF Away Posts: 680
umm, can't see you answered any of the questions asked...
Regards
Karl

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 3 weeks ago #8534

  lumberjack's Avatar lumberjack Offline Posts: 543
Hi Jeff,
I am going to try and make logic of what I see. Is any of this actually working?
METHOD UpdateButton( ) CLASS JobInfo
//  self:oSFJobInfo_DETAIL:FIELDPUT(#JOBTIME, something.... )
  self:oSFJobInfo_DETAIL:server:Commit() 
You using SELF:oSFJobInfo_Detail:Server:Commit(), however you oSFJobInfo_DETAIL:FIELDPUT()...
My logic tells me the code should look like:
//  self:oSFJobInfo_DETAIL:Server:FIELDPUT(#JOBTIME, something.... ) // Note the ":Server" injection
  self:oSFJobInfo_DETAIL:server:Commit() 
The other problem I see potentially:
//  self:oSFJobInfo_DETAIL:FIELDPUT(#JOBDATE, self:oSFJobInfo_DETAIL:JOBDATE)
Is this not one of your datetime picker controls? Then I would think the value will be retrieved as:
//  self:oSFJobInfo_DETAIL:Server:FIELDPUT(#JOBDATE, self:oSFJobInfo_DETAIL:oDTDatePicker2:Value...)
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

Hopefully last question for a while. 4 months 3 weeks ago #8536

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 206
Hi Johan, yes you're 99% correct, except Jobtime and jobndate are fields, not datetime pickers. That's the entire problem. I have a date picker and a time picker (Datetimepicker2 and 3) the return value of which I want to assign to my fields jobtime and jobdate. Problem is the dtp 's are not in scope and unreachable. I put an export for both of them in the jobinfo class, making them accessible, but not initialized...

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2