Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Electronic reporting :...
Finance forum
Answered

Electronic reporting : How to read a container ?

Posted on by 13
Hi experts,

I am trying to do an electronic report based on the table named BatchJob.
My problem is about the field named RecurrenceData which is a container. How can I use it in my report?

The only way I found to read the container is to bind it as follow:


But I would like to read each element of this container and I don’t know how to do it or even if this is possible.

Is it possible to do a "conpeek" in an electronic report?

Thanks in advance for your help.
Guillaume
 
Categories:
  • GF-18061803-0 Profile Picture
    GF-18061803-0 13 on at
    Electronic reporting : How to read a container ?
    The extension works as expected.
    So, the lesson learned is, in an electronic report, container must be used with a class method and not with an ER function.
    I think the idea is to put the logic of the container in a method that can be call everywhere, in another ER report, in a data entity, in another class…
    There is another interesting method: BatchJob. recurrenceText()
    Thanks for your help Martin !
     
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 225,526 Super User on at
    Electronic reporting : How to read a container ?
    How to deal with containers is exactly what we discussed in this thread.
     
    But if you're saying that the only problem you have is that getRecurrenceUnitValue() returns a container, simply add a method (in an extension) that calls getRecurrenceUnitValue(), extracts the number and returns it.
  • GF-18061803-0 Profile Picture
    GF-18061803-0 13 on at
    Electronic reporting : How to read a container ?
    Unfortunately SysRecurrence::getRecurrenceUnitValue() returns a container and I don’t know how to use it in ER. It seems not possible for me. I was so close to finish my report without any custom class :-(
    Anyway, thanks for all the information you provided in this post, I will create a custom class with the help of my technical team and then I will use it in the report.
     
  • Martin Dráb Profile Picture
    Martin Dráb 225,526 Super User on at
    Electronic reporting : How to read a container ?
    You can get the number from SysRecurrence::getRecurrenceUnitValue(). It returns a container; in your case, you're interested in the first value only. It's more complicated when you get into things like "the second Thursday each month"; you can look at SysRecurrenceBuild.defaultValue() to see an overview of what can be there.
     
    I would probably create a custom class (or a temporary table) and populate the data there with the help of SysRecurrence, rather than extending SysRecurrence as such.
  • GF-18061803-0 Profile Picture
    GF-18061803-0 13 on at
    Electronic reporting : How to read a container ?
    Thanks for your answer Martin.
    I already use the SysRecurrence class to get the recurrence pattern with the method getRecurrenceUnit().
    But I don't know how to get the count value (see screenshot below). My idea was to try to understand the container and find the value I am looking for. (I think I found all necessary explanations here https://community.dynamics.com/forums/thread/details/?threadid=641685a1-a924-412b-beef-8763049ef30b).

    So maybe the best thing to do, is to ask to my technical team to develop an extension of this class and then use a new method.
    Do you agree?


  • Martin Dráb Profile Picture
    Martin Dráb 225,526 Super User on at
    Electronic reporting : How to read a container ?
    The whole approach looks wrong to me. You shouldn't try to interpret the container by yourself by something like conPeek(). Instead, use the class that exists for this purpose: SysRecurrence.
     
    For electronic reporting, you can use a class as a data source, or put the data to a temporary table and use that.

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... 287,835 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,526 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans