web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Object not initialized

(0) ShareShare
ReportReport
Posted on by

ProjListProjTransDataContract object not initialized.

Stack trace

(C)\Classes\ProjListProjTransController\prePromptModifyContract - line 11
(C)\Classes\SrsReportRunController\startOperation - line 7
(C)\Classes\ProjListProjTransController\run - line 8
(C)\Classes\ProjListProjTransController\main - line 3
(C)\Classes\FormFunctionButtonControl\Clicked

I'm adding a button to a list page form that opens a ssrs report based on the selected value in the list page. There is an existing similar button on another list page so I basically copied all of the classes/menu items/tables and replaced certain info to work with the new button instead. I've went over it all many times and I can't seem to figure out why I am getting this error. 

If I need to provide more information I can. Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    239,938 Most Valuable Professional on at

    You see that the error is thrown at line 11 of ProjListProjTransController.prePromptModifyContract(), therefore go there and check what's going on.

  • Frantisek Profile Picture
    125 on at

    If you copied this and it is report, check your report name in controller. It is common error when you copy report classes.

  • Community Member Profile Picture
    on at

    protected void prePromptModifyContract()

    {

       ProjTable projTable;

       ProjListProjTransDataContract contract = this.parmReportContract().parmRdpContract() as ProjListProjTransDataContract;

       super();

       if (this.parmArgs()  && (this.parmArgs().record() is ProjTable))

       {

           projTable = this.parmArgs().record();

           contract.parmProjId(projTable.ProjId);

       }

    }

    Line 11 is that last line of code. The code in this method is the exact same as the other controller class aside from names. Below is what the data contract class looks like.

    class ProjListProjTransDataContract

    {

       ProjId projId;

    }

    [DataMemberAttribute]

    public ProjId parmProjId(ProjId _projId = projId)

    {

       projId = _projId;

       return  projId;

    }

    If I comment out that line 11 code in the controller class the report opens with the button, but obviously doesn't fill in the selected project id.

  • Martin Dráb Profile Picture
    239,938 Most Valuable Professional on at

    That this.parmReportContract().parmRdpContract() as ProjListProjTransDataContract returns null can be caused by mean two things:

    1. Either this.parmReportContract().parmRdpContract() returns null
    2. Or it returns an object but it's not ProjListProjTransDataContract

    Please debug your code to see which case it is.

  • Community Member Profile Picture
    on at

    It's returning null

  • Community Member Profile Picture
    on at

    Wondering if this has anything to do with it:

    The report parameter form I copied the information from looks like this:

    74485.Capture.PNG (notice the Project ID field has a dropdown to select the id from)

    Where as the report parameter from that I am trying to use looks like this:

    74485.Capture.PNG

    To fill in the parameters in this from you have to hit the select button first which then has this form pop up74485.Capture.PNG

    After filling in the criteria information, clicking ok then fills in the parameter form.

    So I'm wondering if this is the reason I'm getting these errors and if so is there a way to change the way my form/report works so it works more like the first form with the dropdown menu?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans