In my suitelet code I put ```templateRenderer.addS...
# ask-stanley-ai
a
In my suitelet code I put
Copy code
templateRenderer.addSearchResults({
			templateName: `salesOrderResults`,
			searchResult: soResults
		});
How do I access soResults in an Advanced PDF Template?
1
c
AI generated answer (using internal Slack threads):
In your Suitelet code, you are adding search results to the renderer using the
addSearchResults
method. To access these results in an Advanced PDF Template, you would use the
templateName
you specified when adding the search results. In your case, this is
salesOrderResults
. In your Advanced PDF Template, you can access the
soResults
data using the
templateName
as follows:
Copy code
xml
<#list salesOrderResults as result>
    <!-- Access fields from the result -->
    <div>${result.fieldName}</div>
</#list>
Please replace
fieldName
with the actual field name you want to access from the search results. This will loop through all the search results and print the value of
fieldName
for each result. Remember, the fields you can access in the template are the ones you specified in your search result columns. If you want to use search results or a custom data source to power a template, you need to explicitly specify the fields to pass in the results. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.857238829
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.856323361
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852478087
Please provide your feedback on this answer.