2024 Mar 18 4:07 PM - edited 2024 Mar 18 4:28 PM
Dear Good Morning, query how to select the checkboxes in a group query that is displayed in a grid, photo attached.
When I select the checks and want to print which checks have been marked, I get the following error: "Add-on 9000037 failed with an exception. Event type: 6"
I attached code:
for (int k = 0; k < oGrid.Rows.Count-1; k++)
{
string IsSelected = oGrid.DataTable.GetValue("Select", k).ToString();
System.Diagnostics.Debug.WriteLine(IsSelected);
}
Note: In this string IsSelected = oGrid.DataTable.GetValue("Select", k).ToString(); Error Offset de registro no válido [131-183]
With this I load the grid
cadena = "select CardCode , 'SelectRow' as 'Select',DocEntry, DocNum, CardName, DocDate, DocTotal, DocStatus from OPCH where CANCELED='N' and DocDate between '" + EditText0.Value + "' and '" + EditText1.Value + "' and DocStatus <>'C' group by CardCode,CardName,DocEntry, DocNum,DocDate, DocTotal, DocStatus --and DocType='S' ";
oForm.DataSources.DataTables.Item(0).Clear();
oForm.DataSources.DataTables.Item(0).ExecuteQuery(cadena);
oGrid.DataTable = oForm.DataSources.DataTables.Item("DT_0");
oForm.Freeze(true);
oForm.DataSources.DataTables.Item(0).ExecuteQuery(cadena);
oGrid.CollapseLevel = 1;
oForm.Freeze(false);
oEditColumn = ((SAPbouiCOM.EditTextColumn)(oGrid.Columns.Item("Select")));
oEditColumn.Type = BoGridColumnType.gct_CheckBox;
oGrid.AutoResizeColumns();
oEditColumn = ((SAPbouiCOM.EditTextColumn)(oGrid.Columns.Item("CardCode")));
oEditColumn.LinkedObjectType = "2";
oEditColumn = ((SAPbouiCOM.EditTextColumn)(oGrid.Columns.Item("DocEntry")));
oEditColumn.LinkedObjectType = "18";
// Set columns size
oGrid.Columns.Item(0).Width = 50;
oGrid.Columns.Item(1).Width = 60;
oGrid.Columns.Item(2).Width = 130;
Please your support.
Kind regards
Hi gpam,
Can you try something like below?
oGrid = (SAPbouiCOM.Grid)SBO_Application.Forms.Item(pVal.FormUID).Items.Item("grid").Specific
int dtrow = oGrid.GetDataTableRowIndex(pVal.Row)
if(dtrow <> -1)
oGrid.DataTable.GetValue(pVal.ColUID, dtrow)
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.