Error executing code

Dear Friends,

I am facing the below error can some body please help me solving it.

3465.1.JPG

the above error pops up when i am clicking a menu item button which is calling a report but the report is called via class which has this report in its lastvalueelement name.

now the class already contains the parmfromdate function still it is throwing me the above error

please help me out, thanks in advance.

Hi,

What happens if you comment the call to parmFormDate() method in your report’s init()?

regards,

Thomas

I am guessing you are trying to pass in the formRun object to the report generation class?

In that case, try make the variable as type “Object” instead of “FormRun”,

i.e.

Object formRef; // Instead of: FormRun formRef

it opens up the report dialog and shows report is empty since no from and to date is not found.

the report already is in this way

public class ReportRun extends ObjectRun

and in the init method of the report

this is written

InvoiceCheckList = new ITL_POD_InvoiceCheckListReport();

InvoiceCheckList = element.args().caller();

fromdate = InvoiceCheckList.parmFromDate();

todate = InvoiceCheckList.parmToDate();

where ITL_POD_InvoiceCheckListReport() is my class

the report already is in this way

public class ReportRun extends ObjectRun

and in the init method of the report

this is written

InvoiceCheckList = new ITL_POD_InvoiceCheckListReport();

InvoiceCheckList = element.args().caller();

fromdate = InvoiceCheckList.parmFromDate();

todate = InvoiceCheckList.parmToDate();

where ITL_POD_InvoiceCheckListReport() is my class

where should i try make the variable as type “Object” instead of “FormRun”,

i.e.

Object formRef; // Instead of: FormRun formRef

Hi,

What happens if you comment the .parmFromDate();? Will you get the same message for .parmToDate(); ?

Regards,

OPi

no it opens the dialog … no error nothing but then from where would i get the from date and to date to run the report?

i found one thing it is that element is picking up formrun object instead of reportrun how can i make the element pickup the object reportrun rather than formrun

Hi,

Maybe you can pass them from other parts of the report or the caller.

and how can i do that?

Hi,

What happens if you substitute the new object with a simple ITL_POD_InvoiceCheckListReport InvoiceCheckList declaration?

I guess this is where “InvoiceCheckList” becomes formRun?

You assigned the caller form to the variable invoiceCheckList, maybe that’s why the parm methods are not found.

(I assume the parm methods are in ITL_POD_InvoiceCheckListReport class)

yes dm79 you are absolutely right, thats what i am searching for how to make “InvoiceCheckList” to become reportRun can u suggest something?

  1. Which version you are using?

  2. Have you check the debugger which object was that for elements.args().caller()?

Axapta 3.0

the below lines of code is written in the init method of the report.

ITL_POD_InvoiceCheckListReport = new ITL_POD_InvoiceCheckListReport();

ITL_POD_InvoiceCheckListReport = element.args().caller();

fromdate = ITL_POD_InvoiceCheckListReport.parmFromDate(); → throwing the above screened error here where it changes from reportRun to formRun

Hmm, maybe send me an email with the project/objects?