Skip to main content
Full Circle Insights

Global Response Selector Component SDK

The Global Response Prompt component is an enhanced version of the Response Management Response Selector component. The component supports the following features:

  • Displays available (and permitted) sales campaigns (defined as response prompt campaigns in configuration) that are applicable to the current lead, contact or person account, and allows association of a selected campaign (creating the CampaignMember object accordingly)
  • Optionally display the current active response(s) for the current lead, contact or person account.
  • Optionally display the most recent responses for the current lead, contact or person account.
  • Offers a mechanism to execute code or perform a browser redirect after completion of the association.

This functionality is implemented in global component FCRM.FCR_VFResponseInfoGlobal in the Response Management application. This is a VisualForce Apex Component and can be incorporated into any VisualForce page. It cannot be used directly (outside of a VisualForce page).

This document is intended to be used by developers with at least a basic understanding of VisualForce development.

Adding the Response Selector Component to a page

<!-- Visualforce Page -->
<apex:form>
    <FCRM:FCR_VFGlobalResponsePrompt />
</apex:form>


However, this alone will result in an error result, as it is also necessary to specify the related lead, contact or person account.

This can be accomplished using one of two attributes, recordId, or recordUrlParam. The recordId attribute specifies the ID of the lead, contact or person account that you wish to use. Alternatively, the recordUrlParam attribute specifies a URL parameter containing the ID of the lead, contact or person account that you wish to use.

For example: If the component is placed on a VisualForce page that uses the Contact standard controller, you can define the component as follows:

<!-- Visualforce Page -->
<apex:form>
    <FCRM:FCR_VFGlobalResponsePrompt recordID="{!Contact.id}" />
</apex:form>

If the component is placed on a VisualForce page for a different object, where the URL contains a conid parameter for the desired contact, you can define the component as follows:

<!-- Visualforce Page -->
<apex:form>
    <FCRM:FCR_VFGlobalResponsePrompt recordUrlParam="conid" />
</apex:form> 

You may only specify one of these attributes.

The Response Selector component must be inside of a <Apex:form> tag on the parent page.

Using multiple components on a page

You can add multiple Response Selector components to a single VisualForce page. However, that they MUST reference different records.

Customizing the Response Selector UI

There are a number of attributes you can use to customize the Response Selector user interface.

The Response Selector has three zones for which you can toggle visibility on or off. By default, all zones are displayed.

If one or more active responses exist on the related object, they will appear in the Active Responses zone. You can control display of this zone using the showActive attribute.

If one or more responses exist on the related object, they will appear in the Recent Responses zone. You can control display of this zone using the showRecent attribute.
 

 

If there are no responses on the object, the Response Status zone will display a prompt with instructions to add a campaign. You can control display of this zone using the showStatus attribute.

The various labels that appear in the Response Selector control are defined as custom labels with the category "Response Information". The labels may be overridden as you would any standard custom label. All labels are shared with the standard Full Circle response selector pages and cannot be changed independently.

You can modify the text of the selector button (the Go button) using the buttonText attribute.

There are five additional error messages that you can override using attributes as shown in the following error message table:

Attribute

Default text

errorMessage1 Record ID is not specified
errorMessage2 Record ID must refer to a lead, contact or person account
errorMessage3 Record ID does not refer to a valid record
errorMessage4 Account Record is not a Person Account
errorMessage5 Lead is converted

Additional styling is possible by customizing your CSS styles at the page level. You can use your browser's web development console to identify individual class and element names. Generally speaking, you'll be overriding standard Saleslforce styles, as this component uses the standard VisualForce PageBlock and related components.

Post Processing Functionality

By default, after you have associated a campaign using the Response Selector control, the control will attempt to redirect the browser to the related record. For example: if the component is on a VisualForce page on a lead page layout, it will redirect to the lead and in doing so, refresh the display of the lead. This will work in Salesforce One for Mobile ready pages, and in the Sales and Marketing consoles.

You can override this behavior by providing your own JavaScript function to call when the response association is complete. To do so, specify the name of the JavaScript function as the onProcessCompleteFunction attribute. Do not include parenthesis - just the name of the function. This must be a global (window context) function.

You can use an Apex ActionFunction method as the call for this functionality. Note, however, that a PageReference return from this ActionFunction call will not perform a redirect (as it is in the context of an Ajax call). You will need to explicitly set the window location to perform a redirect at that point.

If you specify a function using the onProcessCompleteFunction, it overrides the default behavior (i.e. the built-in redirection will not take place).

Attribute Reference

The following attributes are defined for the Response Selector component. None of the parameters are required, except that either the recordId or recordUrlParam attributes must be defined.

Attribute

Description

buttonText The text of the 'Go' button used to trigger the campaign association. Default is 'Go'
errorMessage1 Message to use when the Record ID is not specified. See the Error Message table for defaults.
errorMessage2 Message to use when the Record ID refers to an unsupported object. See the Error Message table for defaults.
errorMessage3 Message to use when the Record ID does not refererence a valid record. See the Error Message table for defaults.
errorMessage4 Message to use when the Account Record is not a Person Account. See the Error Message table for defaults.
errorMessage5 Message to use when the Lead is converted. See the Error Message table for defaults.
onProcessCompleteFunction  Name of a JavaScript function to call when a campaign association is complete.
recordId The ID of the related lead, contact or person account record. If specified, recordUrlParam must not be present.
recordUrlParam The URL parameter containing the ID of the related lead, contact or person account record. If specified, recordId must not be present.
showActive Display the existing active response(s). Default is true
showRecent Display the most recent responses. Default is true.
showStatus Display the response status prompt when there are no existing responses. Default is true.

Example

The following demonstrates use of the Response Selector component on a page that uses the Lead as the standard controller.

<!-- Visualforce Page -->

<apex:page StandardController="Lead">
    <apex:detail />
    <apex:form >
    <script type="text/javascript">
      function responsePromptSelected()
       {
           window.location.reload();
       }   
    </script>
    <c:FCR_VFGlobalResponsePrompt recordId="{!Lead.id}" onProcessCompleteFunction="responsePromptSelected" />
    </apex:form>
  
</apex:page>
  • Was this article helpful?