on 05-04-2017 8:37 PM
I believe the problem is the argument you are using "SAPbouiCOM.SBOItemEventArg pVal"
Try to use SAPbouiCOM.ItemEvent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Seems like I was not treating the ChooseFromListAfter event. I found a blog which was helpful:
http://projectservercode.com/add-cfl-into-the-matrix-columns/
Now I'm having the following error
Cannot cast 'SAPbouiCOM.SBOItemEventArgClass' to 'SAPbouiCOM.ChooseFromListEvent'.
My code is as follow:
private void Matrix0_CFLA(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
{
try
{
//It Contains information about the current choose from list event,
SAPbouiCOM.ChooseFromListEvent oCflEvent = null;
//Here pVal is an ItemEvent ,Thus we need to cast it as ChooseFromListEvent to access it as ChooseFromListEvent .
oCflEvent = (SAPbouiCOM.ChooseFromListEvent)pVal; // HERE'S THE PROBLEM
if (oCflEvent.SelectedObjects != null)
((SAPbouiCOM.EditText)Matrix0.GetCellSpecific(pVal.ColUID, pVal.Row)).Value = oCflEvent.SelectedObjects.GetValue("ItemCode", 0).ToString();
}
catch(Exception ex)
{
throw ex;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rudá,
Use this:
IChooseFromListEvent oCFLEvento = (IChooseFromListEvent)(pVal);
Instead:
SAPbouiCOM.ChooseFromListEvent oCflEvent = null;
//Here pVal is an ItemEvent ,Thus we need to cast it as ChooseFromListEvent to access it as ChooseFromListEvent .
oCflEvent = (SAPbouiCOM.ChooseFromListEvent)pVal; // HERE'S THE PROBLEM
Hope it helps.
Kind Regards,
Diego Lother
Same error. SDK Help Center says:
To access this object, cast the ItemEvent object into this object.
Problem is that I can't use ItemEvent as an argument, it must be SBOItemEventArg
this.Matrix0.ChooseFromListAfter += new SAPbouiCOM._IMatrixEvents_ChooseFromListAfterEventHandler(this.Matrix0_CFLA);
Hi Rudá,
Sorry, I didn't see the signature of your method I thought that you used the ItemEvent.
In this case, try this:
ISBOChooseFromListEventArg oCFLEvent = (ISBOChooseFromListEventArg)(pVal);
Hope it helps.
Kind Regards,
Diego Lother
Sooorry, I thought you couldn`t open the CFL.
Yes, you need to treat the ChooseFromListAfter event.
There is a sample on SDK that should help you.
C:\Program Files (x86)\SAP\SAP Business One SDK\Samples\COM UI\CSharp\17.ChooseFromList
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does your column is binded to a datasource? If it is not, you should bind in order to show your CFL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
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.