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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Varnavas,
First of all , a silly question, BP Code 140313 exist in the database?
Secondly, -Linked Value Not Exist- error may caused for the following reasons:
In any case, i want to ask you; the link button that is not working is located at the EditText or at the Grid? Because in case that you have placed it on the grid, make sure that the link button is anchored with BP Code and not CardName. You are not having a CardCode column. In case that you have a Link Button that is connected with the Editext (at the top of the form) even with the EditText contains data, is one other problem.
Kind Regards
Evangelos D. Plagianos
Dear Vaggelis,
Yes, the BP selection filters the results on the grid, so it does exist no worries about silly questions. Many times we all face small simple problems like that one!
I use Int.Parse and i parse from string to Int. The linked button works fine.
The use of Update Button is completely irrelevant with the EditText field with the CFL.
CFL EditText field works as a FILTER for the query that will be run on the grid.
when i issue a change on the grid enabled fields, the "1" button changes to Update.
When i click update the event triggered is correct i just get an extra error below which i show on the first screenshot.
The second screenshot below pops that error when i have a value in the EditText on the top and i click update
User | Count |
---|---|
102 | |
8 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.