cancel
Showing results for 
Search instead for 
Did you mean: 

Internal Error 6001 when a CFL is in a Matrix

Former Member
0 Kudos

Hey guys! I've struggling with this error for over a week and I don't know what else to do

I created an UDO and edited the default form on screen painter (removed some fields and repositioned others). In one of the matrixes I put a CFL (for business partner) in one column, with the ChooseFromListAutoFill set on true. When I choose a CardCode it should also fill another column with the CardName. But when I do that I get an Internal Error (6001).

I tried putting breakpoints in the code, it passes over my code just fine, fills the column with the name then, after it, throws that exception before or during the ChooseFromListAutoFill, I don't know exactly when because it's after my code, so I can't debug.

Here is my code:

IChooseFromListEvent oCFLEvento = (IChooseFromListEvent)pval;

Form oForm = B1AppDomain.Application.Forms.Item(formuid);

if (oCFLEvento.SelectedObjects != null)

{

    DataTable oDataTable = oCFLEvento.SelectedObjects;

    string valCodigo = null;

    string valNome = null;

    switch (pval.ItemUID)

    {

        case "mtxComisso":

        if (oCFLEvento.ColUID == "C_1_3")

        {

            valCodigo = Convert.ToString(oDataTable.GetValue(0, 0));

            valNome = Convert.ToString(oDataTable.GetValue(1, 0));

            Matrix oMatrix = oForm.Items.Item("mtxComisso").Specific;

            Columns oCols = oMatrix.Columns;

            Column oCol = oCols.Item("C_1_4");

            Cell oCell = oCol.Cells.Item(oCFLEvento.Row);

            EditText oEditText = oCol.Cells.Item(oCFLEvento.Row).Specific;

            oEditText.Value = valNome;

        }

            break;

        //cases for other CFLs in the form, no need to copy them here

        default:

            break;

    }

}

Some extra info:

- I didn't define DataSources in my code, since it is an auto generated form for an UDO, other than this CFL problem it saves the data normally, as it's supposed to.

- All the data types are correct, I checked it over and over.

- The CFL works fine when it's in an EditText, this problem occurs only when it's in a Matrix.

- It happens in all CFLs that are within a Matrix.

- I'm using 8.82 PL06.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member183246
Participant
0 Kudos

Hi Tania,

You can try this. It works for me, you can replace If block to following code. It may help full for you.

If you get Selected matrix current row id in "oCFLEvento.Row" then it works

  if (oCFLEvento.ColUID == "C_1_3")

        {

            valCodigo = Convert.ToString(oDataTable.GetValue(0, 0));

            valNome = Convert.ToString(oDataTable.GetValue(1, 0));

            Matrix oMatrix = oForm.Items.Item("mtxComisso").Specific;

         oMatrix .SetCellWithoutValidation(oCFLEvento.Row, "C_1_3", valCodigo);

         oMatrix .Columns.Item("C_1_4").Cells.Item(oCFLEvento.Row).Specific.value = valNome;

        }

- Thanks

Vikas

Former Member
0 Kudos

Hi,

Besides the fact that I prefer Edy's solution (updating DataSource object), a "global misunderstanding" exists in the sample: column 0 or 1... Are just the two first columns of the data returned by the CFL, columns which aren't mandatory to be CardCode and CardName. So my advice is to access these columns from their datanames and not from their index.

Regards,

Eric

edy_simon
Active Contributor
0 Kudos

Hi Tania,

Normally  when you handle the ChooseFromList event, you would update the base datasource (be it UDS, DataTable or DBDataSource).

Updating the field directly in the matrix will throw you that error.

If you insists on updating the field i/o datasource, you can silence the error.

Just wrap it in a try  block and put nothing in the catch block

Regards

Edy

Former Member
0 Kudos

Hey Tania,

We have the same problem as yours. If you have got the solution, please post it.

Thanks in advance.

Khushbu Joshi.

SAP B1 Technical consultant,

AMD Technology Solutions,

Surat, India.