on 2016 Aug 22 3:38 PM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Varnavas,
If you are not using B1Studio for Visual Studio / SBO 9+
follow the sample in your SDK help
C:\Program Files (x86)\SAP\SAP Business One SDK\Samples\COM UI\CSharp\17.ChooseFromList
If you are using SBO9+ and using the new Framework,
Follow the above sample, but instead of these lines :
SAPbouiCOM.IChooseFromListEvent oCFLEvento = null;
oCFLEvento = ( ( SAPbouiCOM.IChooseFromListEvent )( pVal ) );
Use
SAPbouiCOM.ISBOChooseFromListEventArg oCFLEvento = SAPbouiCOM.ISBOChooseFromListEventArg)pVal;
Regards
Edy
User | Count |
---|---|
111 | |
8 | |
8 | |
6 | |
6 | |
5 | |
4 | |
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.