Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to make my control...
Finance forum
Answered

How to make my controller class read contract class ?

Posted on by 382
Hi, 
 
When creating SSRS report, I'm adding a selection in my Data Contract Class, which the plan is to determine it will process a detail or a summary report. In the SSRS report it self, it will have 2 design, for detail and summary.
Question is, in my controller class, what should I write to read that result selection from contract class ?
 
In some blog or thread, I found some example of needed to method  preRunModifyContract(). May I know  it looks ? and how about the method main().
I used to put the report name and design in this main() method. Something like this:
 
        controller.parmReportName(ssrsReportStr(ItemSummaryReport,Empty));        controller.parmArgs(_args);        controller.startOperation();
 
But now what should the main method() need to be written, while we have preRunModifyContract(). 
 
Thanks.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  • Verified answer
    Ken Manhattan Profile Picture
    Ken Manhattan 382 on at
    How to make my controller class read contract class ?
    Hi,
     
    Sorry, for late reply. I change the way I create this report, by not using 2 different TempTable. So, actually it is not solved.
    But the thread can be close, I guess. 
    Thanks
  • Layan Jwei Profile Picture
    Layan Jwei 4,815 Super User on at
    How to make my controller class read contract class ?
    Hi Ken,
     
    Is your issue solved or do you still need help?
     
    If your original question about how to make controller class read contract class is solved, then please verify the answers that helped.
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 3,904 on at
    How to make my controller class read contract class ?
    Hi,
     
    Regarding to 2nd issue
     
    Try the following:
    1- Check the fields on the DataSet of the report for any duplications also the parameters if any were duplicated.

    2- Try to create new report, add the dataset to be your query and copy designs from the old report
     
     
    Thanks
    Waed Ayyad
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
     
  • Waed Ayyad Profile Picture
    Waed Ayyad 3,904 on at
    How to make my controller class read contract class ?
    Regarding to 2nd issue

    Try the following:

  • Layan Jwei Profile Picture
    Layan Jwei 4,815 Super User on at
    How to make my controller class read contract class ?
    Hi Ken,
     
    I think this is another issue.
    So is the report name error gone now when debugging or not?
     
    Regarding the 2nd error, do you have two fields with the same name?
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Ken Manhattan Profile Picture
    Ken Manhattan 382 on at
    How to make my controller class read contract class ?
    Probably it's because my RDP class. There are 2 temptable, which actually not too sure that is the way of doing it.
    Why I can say this, because I realized my report data set missing 1 parameter: the checkbox for "isSummary" (btw this checkbox is newly added after I make sure the report is fine for just 1 Design and 1 temptable, for the "Details" only) but if I tried to restore will show error:
     
    And I get the same message if I open Dataset property - Query. 
     
    Thanks.
     
  • Layan Jwei Profile Picture
    Layan Jwei 4,815 Super User on at
    How to make my controller class read contract class ?
    Hi Ken,
     
    I think you still need this line in the main method.
    controller.parmReportName(ssrsReportStr(YourReport, Summary));
     
    Then maybe preRun method will override the value. Give it a try please
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Martin Dráb Profile Picture
    Martin Dráb 225,864 Super User on at
    How to make my controller class read contract class ?
    Look at where the exception is thrown, e.g. by checking its StackTrace property. So far, all you know is that it something called inside startOperation().
     
    My guess is that some logic requires a report name already selected before reaching preRunModifyContract(). Debugging will tell you more.
  • Ken Manhattan Profile Picture
    Ken Manhattan 382 on at
    How to make my controller class read contract class ?
    Hi,
     
    Thanks, but unfortunately I'm hit run time error ->
     
    Just to share, the way I call is just by creating output menu item and set to this controller class. If I understand correctly, all class should first call this main() method, am I right to say that ? Is there some method missing in this controller class, because looks like the report name has not been hit (have value).
     
    Perhaps some other information I should share ? Sorry, this is my first time create something like this, so I don't know as well what important information I should tell earlier.
     
    Thanks.
     
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 4,815 Super User on at
    How to make my controller class read contract class ?
    Hi Ken,
     
    Just rename the variable to sth else. Or say reportName=... Without declaring it as it's already defined. Or do like i showed you
     
    contract.Summary()?this.parmReportContract().parmReportName(ssrsReportStr(YourReport, Summary)) : this.parmReportContract().parmReportName(ssrsReportStr(yourReport, Detail));
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,584 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,864 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans