on 01-18-2005 10:49 AM
Hi
I am updating a matrix and some of the columns are combo box's. I can set the value of these with code like the following -
Set ocombo = omatrix.Columns("U_Type").Cells(Val.Row).Specific
ocombo.Select "2", psk_ByValue
I would like to set these via a user defined data source as it seems much more reliable and doesn't seem to fire off a load of events
Does anyone know how to do this please ?
Regards Andy
Hello Andy,
Unfortunatly, system matrixes do not support all the methods that are supported by user matrix (GetLineData, SetLineData is just an example)
is the determination of the value in the combobox derived from other values in the row or header?
did you consider to use formatted search in order to set the combo selection?
Regards, Avi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Avi
I am setting the combo box depending on other values in the same row. It is working ok at the moment but the screen flickers a bit ( the system has to scroll the matrix horizontally ) as I am setting these boxes. Also it seems when I set it loads of events are generated. When you set values via a user data source you don't seem to get all those extra events
Any advantage in upgrading to 2004 ?
Regards Andy
Hi,
If the values you set in the combobox are dependant on the values in the same row, you could use formated searchs instead of developing an AddOn.
Just create a user query that uses the values of the matrix like this:
SELECT ItemCode from OITM T0 Where T0.ItmsGrpCod =$[$4.2.0]
--4 is the item number of the matrix,
--2 is the column number.
Set a formated search in the field you want to. Asign the query to it, and say it to execute when a dependant value is updated.
Keep in mind that the value that returns the query should be one of the possible values of the combobox.
Regards,
Ibai Peñ
Hi Ibai
I have never used a formatted search before, I would like to stick to code if possible. I am not sure if this would work as the order may contain more than one occurence of the same stock code, which I would have thought may give me a problem with a formatted search.
I am working in 6.5, same limitations in 2004 ?
Regards Andy
Hi,
First I will suggest you to read about formatted searches. They are very usefull, and give lot of possibilities spending very few time and without coding anything (just a sql query).
You can find information about how they work on the SMB portal, under Service & SupportKnowledge & ServicesKnowledge BaseCustomizingFormatted Search.
Then when you know what tools you can use, select the one that best fits your needs.
Following your problem, I dont think that containing more than one occurence of the same stock code is a problem for formatted searches. Not in 6.5, neither in 2004.
The only limitation is that in a matrix you can not use lines appart from the current or the first.
Regards,
Ibai Peñ
Hi,
You are right, it will be much better in performence terms do use UserDataSource instead of firing oee a lot of UI events
you can do it as follows:
'Define UserDataSource
oForm.DataSources.UserDataSources.Add "Type", dt_SHORT_TEXT
'bind the column to sn User Data Source
oMatrix.Columns("U_Type").DataBind.SetBound True, "", "Type"
'====================================
oMatrix.GetLineData Val.Row
oForm.DataSources.UserDataSources.Item("Type").Value = "2" 'set the VALUE (not the description) of the required valid value
'Note, since version 2004, you should use 'ValueEx' instead of 'Value'
oMatrix.SetLineData Val.Row
Regarda, Avi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
6 | |
5 | |
5 | |
5 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.