on 08-23-2004 4:53 PM
Hi all,
i have a question:
if i try to add with code a custom column in matrix's form=133, i don't add the new column.
Therefore, i add the new column with Sap Business One Client and this column is the last column of my matrix.
It's possible to add column in existing matrix with code?
Best Regards
Serema
Dear John,
i have tried your mode, but i have the same error.
my code:
righe = 7
Set frm = SBO_Application.Forms.Item(FormUID)
Set matrice = frm.Items("38").Specific
matrice.DeleteRow (righe)
Set oColumns = matrice.Columns
Set oColumn = oColumns.Add("Nr", it_EDIT)
oColumn.TitleObject.Caption = "Nr"
oColumn.Width = 30
oColumn.Editable = False
Set dbEdit = frm.DataSources.DBDataSources.Add("INV1")
oColumn.DataBind.SetBound True, "INV1", "U_BNVuotP"
matrice.AddRow (righe)
Best regards
Serema
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I added a new user defined field "U_BNVuotP" to "OITM" with oUserFieldsMD, and then
tried to add a new column into existing matrix with
the sample code, but failed.
Error message is
"Data Source - Alias Not Found"
at the following line.
oColumn.DataBind.SetBound True, "INV1", "U_BNVuotP"
Could you please help me?
Message was edited by: Jinsuh Lee
If you add a new User Defined Field in a System Form the column will automatically be added to the Matrix (it will also be automatically linked with the corresponding DBDataSource).
Usually it will be added after the last existing one.
If you cannot see it you must go to the SAP Business One "Form Settings" icon in the ToolBar and select the columns you want to see.
Hope it helps
Trinidad.
Which event are you catching to add the row?
Can you please show your code?
You need to modify the form everytime it is loaded, and to add a row the matrix must have no rows... How do you do it?
I have tried my self to add a column in a system form(removing all rows before) and I have the same error as you.
I think you must create a message into the Service Marketplace, I'm not sure wether or not this functionality is allowed.
Please post a message if you have an answer.
Regards
Trinidad.
My code for to add column in the existing matrix:
Case et_FORM_LOAD
Set frm = SBO_Application.Forms.Item(FormUID)
Set matrice = frm.Items("38").Specific
Set oColumns = matrice.Columns
Set oColumn = oColumns.Add("Nr", it_EDIT)
oColumn.TitleObject.Caption = "Nr"
oColumn.Width = 30
oColumn.Editable = False
Set dbEdit = frm.DataSources.DBDataSources.Add("INV1")
oColumn.DataBind.SetBound True, "INV1", "U_BNVuotP"
But i have an error in row:
oColumn.TitleObject.Caption = "Nr"
Why?
Serema
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can't add columns to a matrix when it has rows. When you open a system form, the matrix will already have a row in it with blank values displayed.
Try deleting the existing row before adding the column, and then re-adding the blank row after you have finished.
matrice.deleterow
.
.
.
matrice.addrow
John.
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
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.