CPQ Self Service

It looks like there is a need for some guidance here.  Sorry I have been dormant for the last while.  Busy busy with CPQ configurations and a growing company!  😀 

As far as CPQ Self Service goes: This is not out of the box and when this link references Self Service with a Customer Community, it means that you can display your CPQ interface in a Customer Community.  That is it.  There’s no other special “Customer Only” interface that is nice and looks like a shopping cart you’d see on a website somewhere.

CPQ Self Service is a highly customized (Visual Force and APEX Code and javascript and CSS) way to give your customers an *almost* cart.  I used the Line Editor and Configurator but that’s it.  All other navigation is Visual Force.  So here’s a high level step by step:

  1. Create Visual Force Page for entering in their contact information.  We did it on the Lead and put a Lead reference on the SBQQ_Quote.
  2. On Save (in APEX controller for VF Page), Create Lead, Create Quote, attach Quote to Lead, forward user to Line Editor for that Quote.
  3. Remove all Custom Actions from the Line Editor.
  4. Create Visual Force Page to navigate to after they’ve saved their Quote.
  5. Create a Custom Action as a Save button that saves the Quote, generates the Outgoing Document, and then forwards the user to the above VF Page (all of this is APEX).
  6. Make sure your VF Page has a link to the Outgoing Document generated above so the user can download it.
  7. We also did things like:
    1. On Lead creation, assign it to a “Web Quotes” Queue so reps can follow up.
    2. On Lead conversion, assign the created Opportunity to the Quote (attached to the Lead), make the Quote Primary, etc.

JIT User Creation
Your self service solution may include the creation of users with JIT. Here is some code to auto assign a CPQ license to the new user in a trigger on User. Please note that proper updated APEX code standards should be adhered to.

User Trigger

Trigger UserTriggers on User (after insert) {
    // do the user trigger things.
    UserTriggerHelper.doTriggers();
}

User Trigger Helper

public class UserTriggerHelper {
    public static void doTriggers() {
        If (trigger.isAfter) {
            If (trigger.isInsert) {
                UserTriggerHelper.grantCPQLicenseToCommunityUsers(trigger.new);
            }
        }
    }
    
    // grant cpq license to community users.
    private static void grantCPQLicenseToCommunityUsers(List<User> users) {
        // create list of user package licenses to insert.
        List<UserPackageLicense> uplsToInsert = new List<UserPackageLicense>();

        // query the package license for cpq.
        PackageLicense pl = [SELECT Id FROM PackageLicense WHERE NamespacePrefix = 'SBQQ'];

        // query the community user profile.
        Profile p = [select id from Profile where Name = 'MyCommunityProfile'];

        // loop through the users.
        for (User u : users) {
            // if this user's profile id equals the community user profile id,
            if (u.ProfileId == p.id) {
                // add a new user package license set to this user and the cpq package license 
                // to the user package licenses to insert list.
                uplsToInsert.add(new UserPackageLicense(UserId = u.id, PackageLicenseId = pl.id));
            }
        }
        
        // if we have user package licenses to insert,
        if (uplsToInsert.size() > 0) {
            // insert the user package licenses.
            insert uplsToInsert;
        }
    }
}

D P

9 thoughts on “CPQ Self Service

  1. Hi Palmer, may i know what are licences do we need to implement CPQ self service? .Also may i know at which point user will need to login to Salesforce in check out process?

    1. Hey Ravi,

      Unfortunately, there is no check out process. There is no self service offered by Salesforce CPQ. This is a “you write your own self service” thing. When you implement your own check out process, you get to say when they log in.

      If you make your self service with a community, you will need the CPQ Community licenses if you want your customers to log in. You’ll be able to utilize the register/login part of the community for this. You’ll need some automation to grant new users Community CPQ Licenses. I believe you can also purchase CPQ Community by access/page load from SFDC.

      If you do it with a site, you can configure a user in the site to access your vf pages with, so your customers don’t have to log in. If you do want them to log in, with a site, you’ll have to write your own login/register logic.

      Thanks,
      Dennis

  2. Hi Palmer,

    I see that you are quite versed in CPQ which I am learning due to a request I received and have no idea if this can be done out of the box, or if a Trigger will need to be created to do this. CPQ and JIT in a Community.

    The ask is this:
    – User is going to use the JIT feature to create new Community users on the fly
    – User would like to also be able to have the JIT (Just In Time provisioning) feature assign the CPQ license to the new user
    – From research, I cannot find anything that speaks to this and from what I am reading on JIT, the license assignment of CPQ will need to be done using a Trigger.

    Just wanted to pick your brain here and see if you had any experience with this type of scenario?

    Much Appreciated,
    Mark

    1. Hello Mark,

      I researched this while implementing a self service solution for a client. Yes it will need to be done with a trigger. Here is some sample code:

      PackageLicense pl = [SELECT Id FROM PackageLicense WHERE NamespacePrefix = ‘SBQQ’];
      insert new UserPackageLicense(UserId = :newUserId, PackageLicenseId = pl.id);

  3. Hi Dennis,

    Thanks for sharing your experience and details on the topic. I don’t see any more details anywhere, even from SF.

    Once CPQ is enabled from community, can user (say Partner) create amendment or renew subscription with self-service? If we are not looking for cool user experience & eCommerce UI, that is if we keep everything OOB, can external user amend contracts? what functionality available to internal user is not available to external user?

    Thanks for your help!

    Regards,
    Sunil Annam

    1. Hi Sunil!

      Thanks for reaching out. Unfortunately, “Self-Service” is not an official thing. It is a thing you create from scratch. The answer to your questions:

      Yes. An external Partner user can do things like amend and renew. You have to enable all of this manually within the community configuration. You must add all pertinent CPQ components in order for this to work properly. I do not know of any functionality you can’t enable for an external user.

      Keep in mind, when you do this, you must implement sharing rules on your accounts / opps / quotes / contracts so partners can not see each other’s data.

      Regards,
      Dennis

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.