Skip to Content
0
Jun 11, 2018 at 09:22 AM

How to get UDO form reference?

124 Views

Dear experts,
I develope Addon using SAPBusinessOneSDK ("new" framework 9).
On menu event I need to call method on my active MyUDOform.
How to get reference to my MyUDOform?
When I get Application.SBO_Application.Forms.ActiveForm (SAPbouiCOM.Form) I can not cast it to MyUFOform (inherit from SAPbouiCOM.Framework.UDOFormBase).

if (pVal.BeforeAction == false && pVal.MenuUID == "1281")
....
MyUDOform mf;
mf = (MyUDOform)Application.SBO_Application.Forms.ActiveForm;
mf.callSomething();

There is convert exception between COM and not COM object.
How to resolve this problem?

best regards Michal