function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Oliver Freeman 9Oliver Freeman 9 

Custom Console Components

Hey there,

We use a visual flow in Salesforce to generate quotes for repairs, and within the flow, there is a checkbox at the final screen to allow the user to add the quote as a case comment at the end of the flow for future reference. The case ID variable within the flow is 'caseId'.
Usually, caseId is passed in the flow URL as a parameter, as the flow is ran from a URL button on the case page layout, which works perfectly.

I had a thought over the weekend to allow service console users to run the flow from a console component, so I went about creating a Visualforce page to use in the console component:
 
<apex:page standardController="Case">
    
    <apex:iframe src="/flow/Quote_Generator" scrolling="true" id="theIframe"/>
    
</apex:page>
You're probably wondering why I'm using <apex:iframe> - the reason behind this, is that we use the Lightning Runtime for our flows, so that they look a lot nicer for our users.
The component works and the flow runs fine, but obviously I need to pass the current subtab object ID into the flow URL.
I've done a little reading on the Service Console Integration Toolkit, and found that I should be able to do this using 
getFocusedSubtabObjectId()
But I won't lie, I'm not really sure where to start with passing the object ID into the flow URL, and wondered if any of you guys would be able to give me some guidance as to where I should start here.

Would greatly appreciate any help :)

Thanks,
Oli