xsharp.eu • Array Expression or Method in Fillusing - Page 2
Page 2 of 2

Array Expression or Method in Fillusing

Posted: Tue Aug 13, 2019 4:44 am
by lumberjack
Jeff,
BiggyRat wrote:LOL because of your code! :)
Nope not my code, check you original posting, it was DataWindow... :cheer:

Array Expression or Method in Fillusing

Posted: Tue Aug 13, 2019 6:00 am
by BiggyRat
D'Oh! Sorry, my bad. Thank you Johan, you put me on the right track. I thought it had something to do with the order of things somewhere. I foolishly thought VO would create the init file with things in the correct order.. I moved that section of code to immediately after when the server is attached, and it worked.... MOSTLY.

Now, all I have to do is work out how to rebuild the array when the record changes...

Array Expression or Method in Fillusing

Posted: Tue Aug 13, 2019 6:26 am
by lumberjack
Jeff,
BiggyRat wrote: Now, all I have to do is work out how to rebuild the array when the record changes...
How is the record number changing? Behind a Skip button(s)?

Array Expression or Method in Fillusing

Posted: Tue Aug 13, 2019 6:56 am
by Karl-Heinz
BiggyRat wrote: Now, all I have to do is work out how to rebuild the array when the record changes...
Hi Jeff,

you can do that in the Window Notify() method.

Code: Select all

METHOD Notify( kNotifyName , uDescription ) CLASS yourwin
LOCAL xRet AS USUAL

	xRet := SUPER:Notify( kNotifyName , uDescription )	
	
	IF kNotifyName >= NotifyRecordChange .AND. kNotifyName <= NotifyGoTop

          self:FillComboBox()


	ENDIF

	
	RETURN xRet


Method FillComboBox() class yourwin	

oYourCmb:fillusing ( {{self:Server:FIELDGET(#CLCONTACT), self:Server:FIELDGET(#CLCONTACT)}, ;
               {self:Server:FIELDGET(#SCONTACT), self:Server:FIELDGET(#SCONTACT)}, ;
               {self:Server:FIELDGET(#REPCONTACT), self:Server:FIELDGET(#REPCONTACT)}} )

oYourCmb:currentitemno := 1

return self

But honestly, i don´t understand what you are trying to achieve, when you fill each time the record pointer is moved a comboxbox with self:server content ? What happens if the user selects a combobox item ?

regards
Karl-Heinz

Array Expression or Method in Fillusing

Posted: Tue Aug 13, 2019 7:28 am
by BiggyRat
"How is the record number changing? Behind a Skip button(s)?" Exactly Johan. I have sorted it out though thank you very much again for your help.

"But honestly, i don´t understand what you are trying to achieve, when you fill each time the record pointer is moved a comboxbox with self:server content ? What happens if the user selects a combobox item ?"

As I said in my initial post Karl-Heinz, each Company record has up to 3 contacts, each with their own email address and phone number. On my window I have 2 fixed texts - EmailTxt and PhoneTxt Based on the selected item in the ComboBox, I assign the appropriate email and phone details as captions to those fixed texts. That way the user can select which contact they want for that company, without having to switch screens...

This should show you EXACTLY what's going on:

https://cl.ly/30d9b94cd2d5

Array Expression or Method in Fillusing

Posted: Tue Aug 13, 2019 7:47 am
by Karl-Heinz
ok, i got it :-)

regards
Karl-Heinz

Array Expression or Method in Fillusing

Posted: Tue Aug 13, 2019 7:56 am
by lumberjack
BiggyRat wrote:"How is the record number changing? Behind a Skip button(s)?" Exactly Johan. I have sorted it out though thank you very much again for your help.
Glad we could be of help.
As I said in my initial post Karl-Heinz, each Company record has up to 3 contacts, each with their own email address and phone number. On my window I have 2 fixed texts - EmailTxt and PhoneTxt Based on the selected item in the ComboBox, I assign the appropriate email and phone details as captions to those fixed texts. That way the user can select which contact they want for that company, without having to switch screens...
This should show you EXACTLY what's going on:
Thanks for sharing, I do understand what you want to achieve, was just a bit of effort to get behind the code logic. Well done and good luck with the rest... We waiting in anticipation for the next challenge :P