cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Call a java method from Mega macro

saikrishna7978
Super Contributor

Hi ,

 

I am able to create java class under com.mega.test.

I want to create mega macro which calls a method in test class passing mega  root and object as parameter. I created mega macro defining package name and class name. My method in class is testjavacall  . I was not able to call java method from mega macro. I tried GetRoot.CurrentEnvironment.getMacro("test").testjavacall GetRoot, <object> .

I am not able to find the right syntax i tried from metacommond it works but i need to call it from a mega macro.

Could you please help if any one has solution.

Thanks for your support.

2 Replies

I am getting the below error stating that Object doesn't support this property oRoot.CurrentEnvironment.GetMacro('..').test
I tried without parameters too calling method I get the same error, I did not define constructor also. Same issue I face I followed all the steps according to the document of mega

smigliore
MEGA
MEGA

Dim macro : Set macro = oRoot.getcurrentEnvironment.getMacro("myjavamacro")

macro.testJavacall oRoot Megaobject

 

keep in mind that java constructor must be defined without parameter