Alright Dudes,
I'm just getting into the murky world of Reporting (AX 2009 - Old Skool) and am tying myself in knots trying to add some data to a report. I'll try and give you the details as succinctly as possible, but feel free to ask for clarification if I appear to be talking nonsense - To further complicate matters, my organisation uses a plug-in set of modules called PeoplePoint which allow the management of healthcare facilities, that means that the table names, etc. may not be familiar to most of you!!! Okay, here goes:
I am trying to edit an inbuilt report to allow our different facilities to have their own names, addresses and bank details included in the footer of the report. However, to make it slightly easier, I'll start off with the payment reference, which should be the User ID (CustTable.AccountID) and the Surname (CustTable.ECL_ACMLastName). Thankfully the Account ID was already included in another part of the footer so I just copied the DataMethod (residentNoFooter) into a new Field and off it went. The surname, however is defeating me.
I needed to create a new DataMethod for this field but have no previous experience with DataMethods, etc. so am trying to wing it. It is not going well.
The classDeclaration (in the top level Methods for the Report) seems to be where variables are declared so I added a new variable next to those already declared for residentName and residentNameFooter (created within the Name of ECL_ACMResidentName). I called it residentSurnameFooter. Looks a bit like this in the classDeclaration:
Name statementTypeTxt;
CustAccount residentNo, residentNoFooter;
ECL_ACMResidentName residentName, residentNameFooter, residentSurnameFooter;
ECL_ACMFacilityName facilityName, facilityNameFooter;
An existing Method setResidentDetailsFooter() looked like it was where I needed to tell AX what the residentSurnameFooter was equal to, so I added the following line (in red):
void setResidentDetailsFooter()
{
;
residentSurnameFooter = custTable.ECL_ACMLastName;
residentNoFooter = custTable.AccountNum;
residentNameFooter = custTable.ECL_ACMSalutation ?
strfmt("%1 %2 %3", custTable.ECL_ACMSalutation, custTable.ECL_ACMFirstName, custTable.ECL_ACMLastName) :
strfmt("%1 %2",custTable.ECL_ACMFirstName, custTable.ECL_ACMLastName);
facilityNameFooter = custTable.ECL_ACMFacilityName();
facilityAddressFooter = ECL_ACMFacilityTable::find(custTable.ECL_ACMFacilityId).Address;
}
Finally I created a new Method as follows:
display ECL_ACMResidentName residentSurnameFooter()
{
return residentSurnameFooter;
}
All of this was through trial and error and I finally got to this stage by troubleshooting the errors that were thrown up when I saved the new code each time.
Now however, when I try and run the report I get the following error:
Error executing code: Wrong argument types for comparison.
(C)\Reports\ECL_ACMResidentTaxInvoiceStatement\Designs\ReportDesign\AutoDesignSpecs\PageHeader:PageHeader\Methods\executeSection
(C)\Classes\ReportSection\executeSection
(C)\Classes\ReportRun\send
(C)\Reports\ECL_ACMResidentTaxInvoiceStatement\Methods\printFees
(C)\Reports\ECL_ACMResidentTaxInvoiceStatement\Methods\fetch
(C)\Classes\ReportRun\run
(C)\Classes\SysReportRun\run - line 143
(C)\Classes\RunBaseReport\run - line 116
(C)\Classes\ECL_ACMResidentTaxInvoiceStatement\main - line 7
I realise that the addition of the PeoplePoint addin may make it tricky to troubleshoot for non-PeoplePoint users, but I'm hoping that I'm just doing (or failing to do) something stupid which is to do with my declarations, etc.
Any advice would be gratefully received and I'd be happy to post further information if necessary. Apologies if my terminology isn't right but I'm a self-taught (read: incompetent) AX programmer without much background in other programming languages, so I make it all up as I go.
Thanks in advance, as ever!
Dan
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (