This topic contains 3 replies, has 0 voices, and was last updated by marcelp 9 years, 3 months ago.
-
AuthorPosts
-
July 31, 2015 at 5:53 am #2132
JohnCColeDoes anyone know if it’s possible to pass search results to the Advanced PDF template in SuiteScript where the search results contain grouped or summed columns? I have tried accessing the columns that are grouped or summed by field name and column index and nothing prints. All non grouped, summed columns in a search result printout fine in the Advanced PDF.
This is a cached copy. Click here to see the original post. -
August 21, 2015 at 11:58 am #2133
marcelpI have also been looking for this answer. I also tried a few things, however none of them returned the value from the group field.
As a workaround, my approach to meet this requirement was:
– Create a new Record Type with the same field names / types returned from the original Saved Search (acting as a Temporary table).
– Execute the Saved Search using the API nlapiSearchRecord getting the grouped data and insert them to the temporary table.
– Create a new Saved Search based on the temporary table.
– Use the addSearchResults method to add the new Saved Search results, and nlapiXMLToPDF in order to generate the PDF result.
– Delete data from the temporary table.
This approach required a lot of additional effort. Does anyone know if there is an easier way to print these grouped fields?
Thank you.
Marcel
-
August 21, 2015 at 2:09 pm #2134
samzadyes it is possible to do so, you have create an xml pdf template in file cabinet and reference it using the following API
nlapiCreateTemplateRenderer
nlapiLoadFile
nlapiXMLToPDF(xml) then use freemarker syntax to display the search results – you may need to look into freemarker resources for directions (also in stackoverflow)
note – use freemarker syntax ,
-
August 21, 2015 at 3:45 pm #2135
marcelpSam,
In the case, the issue is not the Freemarker syntax itself.
When using a reference to a regular field from a Saved Search, it works well. Ex:
${record.custrecord_fieldname}
However, if the Saved Search has fields with a summary type (GROUP / MAX / SUM / COUNT, etc), using the same Freemarker syntax does not work, the field is not displayed (it returns a blank value).
That’s why I had to implement a few more steps to populate a new record type and create a Saved Search with fields that do not have a summary type.
Thank you.
-
AuthorPosts
You must be logged in to reply to this topic.