Hello ,

I am trying to execute a macro on creation of a object. In the macro I used Context.getSelectedObjects() to get the recently created object .But the above method returns empty value. Below my code details.

var objOCC=Context.getSelectedObjOccs()[0];// This is returning empty value
var execProp=Report.createExecInfo("xxxx-xxxx-xxx-xx-xxx",[objOCC],getSelectedLanguage());
var result=Report.execute(execProp,false);

If I change the code ,

var objDef = Context.getSelectedObjects()[0];// This is returning the object
var execProp=Report.createExecInfo("xxxx-xxxx-xxx-xx-xxx",[objDef ],getSelectedLanguage());
//Failing to execute below line,
var result=Report.execute(execProp,false);

Please Help

Regards,

Kartik Sarangi

Tags: macro