Dear Community,
I have been meddling with a weird error on one of my personal addons. The problem is, when I hit update button i get the following error
Below you can see the code of the Update Button;
private void Button0_PressedBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
{
BubbleEvent = true;
if (Application.SBO_Application.Forms.ActiveForm.Mode == SAPbouiCOM.BoFormMode.fm_UPDATE_MODE)
{
int cnt = Grid4.Rows.Count;
int rowIndex, ok;
string CallID;
int count = Grid4.DataTable.Rows.Count - 1;
ProgressBar0 = Application.SBO_Application.StatusBar.CreateProgressBar("Checking Completed Service Calls", cnt - 1, false);
ProgressBar0.Value = 0;
for (int i = 0; i < cnt; i++)
{
try
{
showRow = int.Parse(Grid4.DataTable.Columns.Item("CallID").Cells.Item(i).Value.ToString());
ProgressBar0.Value = i;
ProgressBar0.Text = i + "/" + cnt + " - " + showRow;
}
catch { }
rowIndex = Grid4.GetDataTableRowIndex(i);
if (rowIndex != -1)
{
try
{
CallID = Grid4.DataTable.GetValue("CallID", rowIndex).ToString();
oSCs = ((SAPbobsCOM.ServiceCalls)(Globals.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oServiceCalls)));
oSCs.GetByKey(int.Parse(CallID));
oSCs.UserFields.Fields.Item("U_Completed").Value = Grid4.DataTable.GetValue("Completed", rowIndex).ToString();
oSCs.UserFields.Fields.Item("U_SalesOrder").Value = Grid4.DataTable.GetValue("Sales Order", rowIndex).ToString();
ok = oSCs.Update();
if (ok != 0)
{
Application.SBO_Application.MessageBox(Globals.oCompany.GetLastErrorDescription().ToString(), 1, "Ok", "", "");
}
}
catch { ProgressBar0.Stop(); }
}
}
ProgressBar0.Stop();
}
}
What i noticed though, is that this is caused whenever i use CFL (Choose From List). Here is the CFL Feature i use
The Properties of the EditText Field are:
The CFL datasource properties are:
Any Ideas why this happens?
Hi Varnavas,
Did you assign your form object type as '2'?
Can you post the screen shot of your form properties
Regards
Edy
After you run oSCs.GetByKey(int.Parse(CallID)); try to get the oSCs.CustomerCode value to see what you have there.
Do you have any UDO linked to your form?"
Hello Varnavas,
Have you checked the below discussion? It seems another member managed to resolve the same issue you are having.
How to add a user defined field to Business Par... | SCN
Kind Regards,
Atilla
another thing, when i have a customer code in the CFL edit text and try to update, i receive the following error.
and the update does not occur
Add a comment