on 10-09-2008 2:14 PM
Hi All,
I want to make a matrix columns editable false and true depend on my conditions result.
It is showing an error "Item is not user defined item" in the line **Error**
Can anybody help me to solve this problem?
my coding is as follows
If Trim(sValue) = "Y" Or Trim(sValue) = "Yes" Then
objMatrix.Columns.Item("1").Editable = False
Else
objMatrix.Columns.Item("1").Editable = True ' ***Error***
End If
Hi,
you get this error message when you try this in a System Matrix.
the System Matrix is not a User Defined Item
-> you can't use Editable = True
lg David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
If solved this problem so:
By default I has set matrix columns property Editable=True (editable="1").
<column uid="e1UQty" type="16" title="Quantity" description="Quantity"
visible="1" AffectsFormMode="1" width="91"
disp_desc="0" editable="1" right_just="0" val_on=""
val_off="" backcolor="-1" forecolor="-1" text_style="0" font_size="-1">
<databind databound="1" table="@TABLE" alias="U_Qty" />
<ExtendedObject />
</column>
After loading the form with the matrix and selectection of data into the matrix, I has set the property Editable of column Qty to True.
oMatrix.Columns.Item("e1UQty").Editable = True
Regards
Sierdna S.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
in SBO 2005A SP01 PL 46 Editable = true works (maybe only with UDF and DBDataSource) :
( (Matrix)form.Items.Item("38").Specific ).Columns.Item("U_WREDE_Discount").Editable = true;
No Error is thrown here.
(I have to use it after form.Freeze(true) to write some data in this disabled column, after that I switch again to Editable = false and then unfreeze the form. )
(I'm searching for an solution to set a UDF-column in system matrix as visible and unvisible.)
Kind regards
Christian
***
Hello, .... today it doesn't work anymore
It seems to depend on creating the UDF by code. These new fields were editable for a several time...
Edited by: Christian Bührig on Oct 21, 2008 5:42 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Tamizharasi,
for system items, you can set a editable one enabled = false, while you cannot set uneditable enable = true.
it does make sense for protecting default data integrity.
if in your application, you really need this kind of feature, you can create your own Item, binding with the same datasource which system item binds.
then, you can set enabled = true or false, as you want.
Thanks,
Warren.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When I want to "protect" a matrix column from data entry, I use the following code
to reject input during the "key-down" event in the matrix (using bubble = false).
I use the B1DE wizard to generate the addon on, so instead of a specific function
for key down, you might wrap my code in an IF stmt like this:
(where 3 is the matrix ID on the BOM form, and 4 is the price column):
if pval.EventType =BoEventTypes.et_KEY_DOWN and pval.ItemUID = "3"
' Public Overridable Function OnKeyDown(ByVal pVal As ItemEvent) As Boolean
Try
Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
Dim item As Item = form.Items.Item("3")
Dim matrix As Matrix = item.Specific
If pVal.ColUID = "4" Then
B1App.MessageBox("You cannot override component prices.")
Return False
End If
Catch ex As Exception
B1App.MessageBox(ex.ToString)
End Try
Return True
End Function
Hi...
use this code
Dim OMat As SAPbouiCOM.Matrix
Dim OCols As SAPbouiCOM.Columns
Dim ocol As SAPbouiCOM.Column
Dim oitem As SAPbouiCOM.Item
oitem = OForm.Items.Item("Matrix-ID")
OMat = oitem.Specific
OCols = OMat.Columns
ocol = OCols.Item("Column-ID")
ocol.Editable = False
ocol = OCols.Item("Column-ID")
ocol.Editable = True
Regards..
Billa 2007
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.