In Advanced PDF Templates, is there a freemarker i...
# ask-stanley-ai
a
In Advanced PDF Templates, is there a freemarker interpolation I can use to find out if it's running in Production or Sandbox, so that I can select a different image url depending on that fact?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it appears that there isn't a direct way to determine if the Advanced PDF Template is running in a Production or Sandbox environment using Freemarker interpolation. However, a workaround could be to create a custom field at the company or subsidiary level that stores the environment type (Production or Sandbox). This field can then be accessed in the Advanced PDF Template using Freemarker. Here's a simple example of how you might use this in your template:
Copy code
freemarker
<#if record.custbody_environment_type == "Production">
    <img src="production_image_url" />
<#else>
    <img src="sandbox_image_url" />
</#if>
In this example,
custbody_environment_type
is the custom field that stores the environment type. If the environment is Production, it uses the production image URL, otherwise, it uses the sandbox image URL. Remember to set the value of this custom field appropriately in each of your environments. ****** 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.823486447
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.818908751
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.818481565
Please provide your feedback on this answer.