• D McGovern
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies

I would like to access a Static Resource via a Flow embedded on a VF page so I can display it externally using a public Site.

This help article states that using a URL to reference a Static Resource on a public site doesn't always work correctly, and I found that to be the case. Maybe 30% of the time I tried to access the page externally the image would be visible, and the other 70% of the time it would be broken. Randomly it works, randomly it doesn't. Mostly, it doesn't.

The recommended solution is to use $Resource.[Static Resource path], but I can't figure out how to call an image in Flow using $Resource, because I think I have to use HTML to display an image in Flow.

Is there a way around this limitation?

To recap: using this in Flow fails the majority of the time on a public Site, although it always works fine when the Site is loaded on an authenticated browser instance.

<img src="resource/Test_Images/Test/Image1.jpg" height='300'>
This thread states you can use <img src="{!$Resource}"> on a VF page, but
  1. I can't get it to work in Flow (unknown URL error using that syntax when I inspect the broken image)
  2. It seems as though even if I could use $Resource to access the image, if it gets converted to a URL to be displayed in HTML that would likely fail regularly as well.​

Thanks in advance for any guidance

I was inspired by this post: https://goravseth.com/using-flows-as-a-form-tool-for-external-users, but I get an internal server error each time I try to acess the visualforce page from the code in that post. I have Communities enabled and it's pointing to an active Flow in my org. The steps I took:

  1. Create a Lightning application with provided code in dev console and save
  2. Create visualforce page with provided code in dev console, replace flow name with API name of active flow in my org
  3. Preview and get: An internal server error has occurred Error ID: 2107398568-65430 (-697475282)

First question: why isn't the following visualforce page working?
Lightning application copied:

<aura:application access="global" extends="ltng:outApp" implements="ltng:allowGuestAccess" >
    <aura:dependency resource="lightning:flow"/>
</aura:application>
Visualforce page:
<apex:page >
   <html>
      <head>
         <apex:includeLightning />
      </head>
      <body class="slds-scope">
         <div class="slds-scope">                                                 
         <div id="flowContainer" />
         <script>
            $Lightning.use("c:flowVF", function() {
               // Create the flow component and set the onstatuschange attribute
               $Lightning.createComponent("lightning:flow", {},
                  "flowContainer",
                  function (component) {
                     // Set the input variables                                      
                     // Start an interview in the flowContainer div, and 
                     // initializes the input variables.
                     component.startFlow("test_flow");
                  }
               );
            });
         </script>
         </div>
      </body>
   </html>
</apex:page>

Second attempt was to simply embed the flow on a basic visualforce page and try to make it look like Lightning:
<apex:page lightningStylesheets="true">
    <flow:interview name="test_flow"> </flow:interview>
</apex:page>
...it works great when I open the visualforce page. However, as soon as I switch to Sites:
  1. Lightning style is lost. I'm guessing that lightningstylesheets is something not accessible by a sites guest user, or something along those lines which is why the post I mention above goes through the hassle of creating a component?
  2. Flow doesn't find any records to display. It accepts an email address, looks for a Contact, and displays first name if found. When run via visualforce page directly it works great. When run on Sites, no return for first name. I'm guessing it's because the site Guest Profile doesn't have access to all Contacts, but I only see the option to grant Read and Create permissions, not View All. Is there another sharing/permission setting that I need to update? Where would I go for this?
So...
Ideally I can figure out why the lightning-styled flow via component in a vf page isn't working. Help? Even then, I wonder if I'll have the same trouble accessing all Contacts that I'm currently encountering in my Classic Flow, or if that's another reason for the component workaround.

Thanks for any suggestions.

I would like to access a Static Resource via a Flow embedded on a VF page so I can display it externally using a public Site.

This help article states that using a URL to reference a Static Resource on a public site doesn't always work correctly, and I found that to be the case. Maybe 30% of the time I tried to access the page externally the image would be visible, and the other 70% of the time it would be broken. Randomly it works, randomly it doesn't. Mostly, it doesn't.

The recommended solution is to use $Resource.[Static Resource path], but I can't figure out how to call an image in Flow using $Resource, because I think I have to use HTML to display an image in Flow.

Is there a way around this limitation?

To recap: using this in Flow fails the majority of the time on a public Site, although it always works fine when the Site is loaded on an authenticated browser instance.

<img src="resource/Test_Images/Test/Image1.jpg" height='300'>
This thread states you can use <img src="{!$Resource}"> on a VF page, but
  1. I can't get it to work in Flow (unknown URL error using that syntax when I inspect the broken image)
  2. It seems as though even if I could use $Resource to access the image, if it gets converted to a URL to be displayed in HTML that would likely fail regularly as well.​

Thanks in advance for any guidance

I was inspired by this post: https://goravseth.com/using-flows-as-a-form-tool-for-external-users, but I get an internal server error each time I try to acess the visualforce page from the code in that post. I have Communities enabled and it's pointing to an active Flow in my org. The steps I took:

  1. Create a Lightning application with provided code in dev console and save
  2. Create visualforce page with provided code in dev console, replace flow name with API name of active flow in my org
  3. Preview and get: An internal server error has occurred Error ID: 2107398568-65430 (-697475282)

First question: why isn't the following visualforce page working?
Lightning application copied:

<aura:application access="global" extends="ltng:outApp" implements="ltng:allowGuestAccess" >
    <aura:dependency resource="lightning:flow"/>
</aura:application>
Visualforce page:
<apex:page >
   <html>
      <head>
         <apex:includeLightning />
      </head>
      <body class="slds-scope">
         <div class="slds-scope">                                                 
         <div id="flowContainer" />
         <script>
            $Lightning.use("c:flowVF", function() {
               // Create the flow component and set the onstatuschange attribute
               $Lightning.createComponent("lightning:flow", {},
                  "flowContainer",
                  function (component) {
                     // Set the input variables                                      
                     // Start an interview in the flowContainer div, and 
                     // initializes the input variables.
                     component.startFlow("test_flow");
                  }
               );
            });
         </script>
         </div>
      </body>
   </html>
</apex:page>

Second attempt was to simply embed the flow on a basic visualforce page and try to make it look like Lightning:
<apex:page lightningStylesheets="true">
    <flow:interview name="test_flow"> </flow:interview>
</apex:page>
...it works great when I open the visualforce page. However, as soon as I switch to Sites:
  1. Lightning style is lost. I'm guessing that lightningstylesheets is something not accessible by a sites guest user, or something along those lines which is why the post I mention above goes through the hassle of creating a component?
  2. Flow doesn't find any records to display. It accepts an email address, looks for a Contact, and displays first name if found. When run via visualforce page directly it works great. When run on Sites, no return for first name. I'm guessing it's because the site Guest Profile doesn't have access to all Contacts, but I only see the option to grant Read and Create permissions, not View All. Is there another sharing/permission setting that I need to update? Where would I go for this?
So...
Ideally I can figure out why the lightning-styled flow via component in a vf page isn't working. Help? Even then, I wonder if I'll have the same trouble accessing all Contacts that I'm currently encountering in my Classic Flow, or if that's another reason for the component workaround.

Thanks for any suggestions.
Hello everyone;
I have the following code running fine in Sandbox for all users, and in Production fo all users BUT for public site/guest user.
CCNUSADMIN_CurrencyRates cache is set to Public.
------------
PageReference curRatPR = new PageReference('/resource/CCNUSADMIN_CurrencyRates');
curRatList = curRatPR.getContent().toString().split(',', 0); 
---------
When accessed by the guest user, the following error, on the getContent() line:
avax.net.ssl.SSLPeerUnverifiedException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
---------
My Site SFDC URL is: http://ccnus.force.com/  which is redirected to a custom URL 'us.classiccarnetwork.org', served by a SSL certificate that runs OK. Any idea why I get this message and more important, what I need to do to allow the Public Site user to access this static resources?
Thanks in advance for your help. Best regards,
Jerome