Skip to main content

SelectEntity Component

Zuora

SelectEntity Component

When the Enable Multi-Entity setting is enabled, the SelectEntity component is inserted as the first step of the Quote Wizard. If you need to use the customized logic to assign an entity to quotes, use the plugin interface on the SelectEntity component to implement and register the custom plugin.

The SelectEntity component is available in the Versions 7.2 and later of Zuora Quotes.

This feature is in Limited Availability. If you want to have access to the feature, submit a request at Zuora Global Support

The SelectEntity component consists of:

  • SelectEntity.component
  • SelectEntityComponentOptions.class
  • SelectEntityComponentOptions.ISelectEntityPlugin

ISelectEntityPlugin

Use the ISelectEntityPlugin on the SelectEntity component to customize the entity selection logic in your quoting process.

The ISelectEntityPlugin is executed when user clicks New Quote in a multi-entity org.

Interface class signature of the plugin is:

zqu.SelectEntityComponentOptions.SelectEntityPluginResponse 
   selectEntityForNewQuote 
   ​  ( ID accountId, ID opportunityId)

ISelectEntityPlugin returns the SelectEntityPluginResponse class. The class includes the following properties.

Name Type Description
selectedId ID Salesforce ID of the Billing Entity to be used for the quote
autoSubmit Boolean

If true, the entity will be selected, and users cannot change it.

If false, the entity will be selected in the menu, but the user can change it.

Example Code

The sample code below returns the default entity id of an account and sets the autoSubmit to true so that users cannot change the default billing entity on quotes.

To test the plugin:

  1. Add a custom field, DefaultEntity__c, on the Account object.
  2. Populate the DefaultEntity__c field with an entity Id.
  3. Use the following code to implement the custom SelectEntity plugin.
  4. Register the plugin for the SelectEntity component as described in Component Registration.
  5. Create a new quote and see the entity field pre-populated with the default entity you gave in Step #2.
global without sharing class MySelectEntityPlugin implements 
   zqu.SelectEntityComponentOptions.ISelectEntityPlugin {
      global zqu.SelectEntityComponentOptions.SelectEntityPluginResponse 
    ​     selectEntityForNewQuote(String accountId, String opportunityId) {
            zqu.SelectEntityComponentOptions.SelectEntityPluginResponse resp = 
            ​   new zqu.SelectEntityComponentOptions.SelectEntityPluginResponse();
            Account acc = 
            ​   [SELECT Id,DefaultEntity__c FROM Account WHERE Id=:accountId LIMIT 1];
            if(acc.DefaultEntity__c != null) {        
               resp.selectedId = acc.DefaultEntity__c;
               resp.autoSubmit = true;
            }
            return resp;
      }
}