Unable to get local buffer in class protected method in chain of command in X++
Deleting response as I didn't release this forum has newest posted at the top.
What is the downside to extending useExistingReportData() and return false? Wouldn't this properly force the system to regenerate the data in the tables?
Unable to get local buffer in class protected method in chain of command in X++
Hi Itlabnarmi,
In one of the screenshots you showed us, in "ProcessReport" method, there is a method called createData(), does it get called?
because inside this method, "insertInvoiceHeaderInformation()" gets called, which then calls insertIntoSalesInvoiceTmp() and this one calls the populate method
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
Unable to get local buffer in class protected method in chain of command in X++
Hi Layan Jwei you are absolutely right, in the beginning of report development I exactly did that extend "populateSalesInvoiceHeaderFooterTmp" and "populateSalesInvoiceTmp" methods and set values in extension fields but when I try to debug my extension and standard populate method they are not triggering at all (surprisingly). I also check all reference these method were not using at all (don't why). I already mentioned in my comments below how data are filling in these temp tables.
Unable to get local buffer in class protected method in chain of command in X++
Hi Martin,
I checked that by attaching debugger on SalesInvoiceDPBase.processReport() where the debugger hit and from there it foes into this.useExistingReportData() method which is in SalesInvoiceDP class.
In the SalesInvoiceDP class's useExistingReportData() method data are fetching in localSalesInvoiceTmp and localSalesInvoiceHeaderFooterTmp.
Is there any possibility to update these local buffer.
I also tried by writing COC of SalesInvoiceDPBase.processReport()and trying to get table buffer salesInvoiceTmp and salesInvoiceHeaderFooterTmp (Not local buffer but the table which return from DP class). Unfortunately I am unable to get these buffer too. Please suggest any best possible solution !
Unable to get local buffer in class protected method in chain of command in X++
Hi Itlabnamri,
if you added fields to "SalesInvoiceTmp" and "SalesInvoiceHeaderFooterTmp". Then the correct methods to fill those fields are "populateSalesInvoiceHeaderFooterTmp" and "populateSalesInvoiceTmp"
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áb230,488Most Valuable Professional
on at
Unable to get local buffer in class protected method in chain of command in X++
useExistingReportData() returns true, and therefore the data creation is skipped, if the data was already created for the same transaction. I suspect it's not really the case (that you failed to stop in those methods in debugger may mean that you didn't configure debugging correctly), but even if it is, you can't use that, because you want to intitialize the data and not using old data without your fields being initialized.
First of all, put a breakpoint to SalesInvoiceDPBase.processReport() and check what happens there. If your breakpoint is ignored, enable debugging of Application Suite model (Dynamics 365 > Options > Debugging).
and successfully added and run new design, now I want to add some addition field in report temp tables behind below data sources and added my additional fields.
So to populate those additional fields I write COC of SalesInvoiceDP's method populateSalesInvoceTmp() and populateSalesInvoiceHeaderFooterTmp() but unfortunately these both method were not triggering after attaching debugger. So I debugged code and find that I found that from SalesInvoiceDPBase class it go into useExistingReportData() method.
In useExistingReportData() method it is filling temp table so I write COC of that class and I am unable to get buffer.
UseExistingReportData Method:
My Requirement is just to add some additional fields in both above mentioned tables and to add on my new report design.
Martin Dráb230,488Most Valuable Professional
on at
Unable to get local buffer in class protected method in chain of command in X++
That's the expected behavior. These are methods declared locally in useExistingReportData() and can't be accessed from outside.
Your code does nothing useful; what you're trying select for update are table buffers that don't exist anymore; they ceased to exist at the end of useExistingReportData() (next useExistingReportData() in your extension).
If you explain your business problem to us, we might be able to suggest a solution. So far, all we can say is that your code is wrong, but it doesn't tell us anything about your intentions.
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.