Skip to Content
author's profile photo Former Member
Former Member

New column in existing matrix (formtype=133)

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2004 at 02:04 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2004 at 04:05 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.