Hopefully last question for a while.

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
User avatar
lumberjack
Posts: 723
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Hopefully last question for a while.

Post by lumberjack »

Hi Jeff,
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
Just an observation to make it easier to assist: You need to learn to extract the details out of your code that is applicable:

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
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
Boshof, South Africa
BiggyRat

Hopefully last question for a while.

Post by BiggyRat »

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.
FFF
Posts: 1532
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Hopefully last question for a while.

Post by FFF »

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
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
lumberjack
Posts: 723
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Hopefully last question for a while.

Post by lumberjack »

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
Boshof, South Africa
FFF
Posts: 1532
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Hopefully last question for a while.

Post by FFF »

;) - nope, it was the late Thomas Frey. Back in IIRC '94, first shy steps in 1.0beta...
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
BiggyRat

Hopefully last question for a while.

Post by BiggyRat »

umm, bot please?
BiggyRat

Hopefully last question for a while.

Post by BiggyRat »

umm, back on topic please?
FFF
Posts: 1532
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Hopefully last question for a while.

Post by FFF »

umm, can't see you answered any of the questions asked...
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
lumberjack
Posts: 723
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Hopefully last question for a while.

Post by lumberjack »

Hi Jeff,
I am going to try and make logic of what I see. Is any of this actually working?

Code: Select all

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:

Code: Select all

//  self:oSFJobInfo_DETAIL:Server:FIELDPUT(#JOBTIME, something.... ) // Note the ":Server" injection
  self:oSFJobInfo_DETAIL:server:Commit() 
The other problem I see potentially:

Code: Select all

//  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:

Code: Select all

//  self:oSFJobInfo_DETAIL:Server:FIELDPUT(#JOBDATE, self:oSFJobInfo_DETAIL:oDTDatePicker2:Value...)
______________________
Johan Nel
Boshof, South Africa
BiggyRat

Hopefully last question for a while.

Post by BiggyRat »

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...
Post Reply