Solved

IApexDataSource Only Works with Doubles

  • 24 August 2023
  • 1 reply
  • 69 views

Badge +2

I am using Loop.IApexDataSource to create a custom Apex Data Source. I have followed what documentation exists, and have been using the code examples linked in the documentation. I have tried several template configurations, but no matter what I use, the only fields that properly are populated on the printed out reports are Double fields (and currency). Strings and Dates are blank. I have tested my implementation in salesforce to gaurantee the data is properly being sent to DocGen, but no luck getting back the correctly populated report.

Further, if the double has any decimal places, it will show as blank in the DocGen download, so to be more accurate, only whole number Double fields work.

I have properly retrieved the data from our salesforce database and stored it as a string in the response to DocGen for the query result rows. Again number columns are working 100% correctly, but nothing else is. Again, I have followed the code examples included in the documentation and still have no luck. If string fields worked, I would just find a way to manually load any data into strings before sending it to DocGen, so Strings not working somehow is the most serious of the Schema.DisplayTypes needed to be able to work.

I have gone through the forums and read all of the documentation and code samples, as well as every relevant forum post I can find (which there are not many of, seems few people use this functionality), and have not found anything that could help me solve this issue. Any ideas on or experiences with this problem?

icon

Best answer by Caleb Quick 24 August 2023, 22:14

View original

1 reply

Badge +2

I’m unable to close this, but I misunderstood a previous forum post that actually contained the solution.

If you have any spaces in your field names, everything will function correctly and no errors will be thrown, but DocGen will silently fail to insert the data into the report. If anyone runs into this problem, make field names WITHOUT spaces.

Reply