Policy Automation for B2C Service

Get Involved. Join the Conversation.


    Sheri Hastings
    How to Exit Service Cloud from Within OPA
    Topic posted September 13, 2016 by Sheri HastingsSilver Medal: 2,000+ Points, last edited September 13, 2016 
    207 Views, 4 Comments
    How to Exit Service Cloud from Within OPA

    Here are step by step instructions for exiting Service Cloud from within an OPA interview that is embedded inside Service Cloud:

    First of all why would you want to do this? 

    In my case I have a customer who is ONLY using Service Cloud as a portal for an OPA interview.  The patient logs into service cloud and immediately commences the OPA interview.

    For this application OPA serves as a  medical product selection tool that helps create a list of what the patient wants to sample or order.  The "order"  is later confirmed by an agent. (The advantages for my customer is that the agent does not have to go through the interview process with the patient and the order form created via the OPA interview is neat and standard. And in the back in there is a history of what has been recommended for this patient. The agent can just review the order form incident and then confirm it with the patient and then put that through the order workflow.  The advantage for the end user is that the simple interview creates the order form for them which will be confirmed by the agent.  No phone hold time. Also the explanations for the options are there for them to read/research  as quickly or slowly as necessary with pictures as needed.)

    The order form should  be created ONLY  by the patient herself, or her caregiver or her  caseworker). All of them will have the patient's login information which is just some simple information about the patient. (In this case HIPAA compliance is unnecessary since we are just recommending products based on interview answers and no pulled  information about the patient is visible to the interviewee.)   During the interview we ask who is completing the interview  (first and last name) and their relationship to the patient.  If someone other than the patient or her caregiver or caseworker logs on (for some unforeseen reason) with the patient's information we want explain that they are not eligible to create an order form and then give them a link that will take them out of service cloud completely.


    So How do you do it?

    1. Add a new label to the interview.
    2. Create the following html for the label:
        <b>  <a href ="http://<yourOsvc SIte>.custhelp.com/ci/openlogin/logout/app/home" target="_parent"> Click here to Exit</a></b>


    Note that the target=_parent is very important.
    OPA is running inside a parent service cloud  iframe and you cannot exit service cloud from OPA unless you reference the parent.

    In this case I just take them back to the login page... but you could go someplace besides home if you want.

    3. This label can be shown if some condition is met, if that is what you need. So in my case I show this (and only this) if the person completing the interview is someone other than the patient, caregiver or caseworker. 

    (Written with gratitude  to Chris Fellows who told me about the https:<sitename>/ ci/admin/login/logout URL )

    Service Cloud, Customer Portal, Connect May 2016
    Code Snippet:



    • Scott Heidenreich

      I like this!  

      I have the opposite problem.  We have a number of OPA applications that need to be used by customers logged into the customer portal.  However, if they find the OPA application before they are logged in they get a nasty banner error message.  Then when they log in they are taken to their account page instead of continuing on with the OPA application.  So I either want the OPA application to check to see if they are logged in and if not log in or create an account for them, or have the answer have a login/sign up function that allows them to continue with the application instead of going to their account profile page.

      Any help would be appreciated.



    • Steven Robert

      Hi Scott

      I belive that what you are describing can be achieved via PHP development in the customer portal, but OPA itself won't be able to control logging in and out.

    • Sheri Hastings

      Can't you just check in OPA if they are logged in (look at a passed in customer field and if it is unknown they are not logged in) and send them a message as part of the OPA interview?


    • Scott Heidenreich

      For applications where the user is required to be logged in, OPA automatically knows whether someone is logged in and errors out right away before the application launches.