Launch Omniscript from a List Button (Managed Package)

For the managed package runtime, configure an Omniscript to launch from a List button for a related list on a record page.

Managed Package app icon This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

  1. From Setup, create an Apex class, paste in the following code, and click Save:
    public class tenPageSizeExt { 
       public tenPageSizeExt(ApexPages.StandardSetController controller) { 
          controller.setPageSize(10); 
       } 
    }
  2. From the Omniscript designer, click How to Launch.
  3. Copy one of the code examples under Embedded. Edit or remove the prefill parameter as needed.
    For example:
    <c--opportunity--updatestatus-english 
    prefill='\{"ContextId":"{!Account.Id}"}' layout="lightning">
    </c--opportunity--updatestatus-english>
  4. From Setup, create a Visualforce page and specify a Name and Label.
  5. Paste the code copied from the Omniscript between the <apex:page> and </apex:page> tags.
    For example:
    <apex:page>
    <c--opportunity--updatestatus-english 
    prefill='\{"ContextId":"{!Account.Id}"}' layout="lightning">
    </c--opportunity--updatestatus-english>
    </apex:page>
  6. Add controller and formatting code to the <apex:page> tag, then click Save.
    For example:
    <apex:page standardController="Opportunity" recordSetVar="opportunities"
    tabStyle="Opportunity" extensions="tenPageSizeExt">
    <c--opportunity--updatestatus-english 
    prefill='\{"ContextId":"{!Account.Id}"}' layout="lightning">
    </c--opportunity--updatestatus-english>
    </apex:page>
  7. From Setup, click Object Manager and go to the object page for the object relevant to the Omniscript.
    For example, type Opportunity in the search field and click Opportunity.
  8. From the object page, click Buttons, Links, and Actions.
  9. Click New Button or Link, specify a Name and Label, and specify a Display Type of List Button.
  10. Select Display Checkboxes (for Multi-Record Selection) if your List button requires users to select individual records in the list.
    The related list type must be set to Enhanced List.
  11. Change the Content Source to Visualforce Page.
  12. From the Content dropdown, select the Visualforce page you created.
  13. Click Save.
  14. From the object page, click List View Button Layout.
  15. Move the button you created from the Available Buttons list to the Selected Buttons list and click Save.