Knowledge Center

Knowledge Center > Zuora CPQ > Zuora CPQ Development Resources > Zuora CPQ Component Library > Zuora CPQ Global Classes > QuoteWizardManager Class

QuoteWizardManager Class

The QuoteWizardManager class provides global methods for quote wizard navigation and easy access to quote wizard configuration metadata.

The QuoteWizardManager class is available in the Versions 6.0 and later of Zuora Quotes.

See Creating Custom Quote Wizard Pages for resources, templates, and sample code needed to create custom quote wizard pages.

QuoteWizardManager Page Navigation Methods

The following global methods are used to control the page navigation of the quote wizard. All of the methods returns the static PageReference type.

Method Input Parameter Description
navigateNext

Map<String,String> UrlParams

  • Required
  • Used to specify the URL parameters to the landing page

String SubscriptionType

  • Used when switching the subscription type after the wizard has been invoked
  • Optional if navigating to the next step in the quote wizard for the current Subscription Type
  • This parameter will update the progress bar at the top of the page based on the metadata in the quote wizard configuration. 
  • Valid values are:
    • "Subscription"
    • "Amendment"
    • "Renewal"
    • "Cancellation"

Navigates to the next step in the quote wizard.

If this method is called from the last step in the quote wizard process, a PageReference is returned that points to the Quote Detail page of the quote. 

Use the finish method to redirect to a different page upon finishing the quote wizard .

This method does not update any fields, such as zqu__SubscriptionType__c or RecordTypeIdon the Quote object.

navigateBack

Map<String,String> UrlParams

  • Optional
  • Used to specify the URL parameters to the landing page

Navigates back one step in the quote wizard. If unable to navigate back, that is, the current page is the first step, this method returns a null PageReference and remains on the current page.

start

String SubscriptionType

  • Required
  • Valid values are:
    • "Subscription"
    • "Amendment"
    • "Renewal"
    • "Cancellation"

Integer InitialStepNumber

  • Optional
  • Used to specify another initial step other than the first step
  • Defaults to 1 if not specified

Map<String,String> UrlParams

  • Optional
  • Used to specify the URL parameters to the landing page
  • Defaults to null if not specified

Defines the initial entry (starting point) to the the quote wizard.

finish

zqu__Quote__c Quote

  • Required argument to upsert the Quote SObject

String FinishUrl

  • Optional
  • If omitted or passed in as blank value, this method returns a PageReference to the Quote Detail page of the Quote argument.

zqu__Quote__c Quote.

  • Required argument to upsert the Quote SObject.

Finishes the quote wizard and optionally redirects to a developer-specified page. This method upserts the Quote SObject passed in as the first argument.

cancel

String CancelUrl

  • Required
  • Valid page URL to redirect

Exits the quote wizard and redirects to a page with the URL of CancelUrl. This method deletes the Quote object for the wizard instance and all child objects of the quote.

Example Code

navigateNext Method

Example 1:

Navigates to the next page in this instance of the quote wizard and places the ID of thisQuote in the URL parameters:

zqu.QuoteWizardManager.navigateNext(new Map<String, String> {'Id' => thisQuote.Id}) 

Example 2:

Navigates to the next page in this instance of the quote wizard for the Amendment subscription type, and places the ID of thisQuote in the URL parameters:

zqu.QuoteWizardManager.navigateNext(new Map<String, String> {'Id' => thisQuote.Id}, 'Amendment')

navigateBack Method

Example:

Navigates back one page in the quote wizard and places the ID of the opportunity object associated with this quote in the URL parameters:

zqu.QuoteWizardManager.navigateBack(new Map<String, String> {'oppId' => thisOpportunity.Id})

Start Method

Example 1:

Explicitly calls the subscription type, initialStepNumber parameter of 1, and map of URL parameters:

zqu.QuoteWizardManager.start('New', 1, new Map<String, String>{'oppId', '009p000000185EJ'})

Example 2:

Performs the same action as the first example without explicitly specifying a map of URL parameters:

zqu.QuoteWizardManager.start('New', 1)

Example 3:

Performs the same action as the first example where the InitialStepNumber parameter is not specified:

zqu.QuoteWizardManager.start('New', new Map<String, String>{'oppId', '009p000000185EJ'})

Example 4:

Performs the same action as first example  where the InitialStepNumber parameter and a map of URL parameters are not specified:

zqu.QuoteWizardManager.start('New')

Finish Method

Example 1:

Upserts thisQuote, exits the quote wizard, and redirects to the Quote Detail page of thisQuote:

zqu.QuoteWizardManager.finish(thisQuote) 

Example 2:

Upserts thisQuote, exits the quote wizard, and redirects to myCustomPage:

zqu.QuoteWizardManager.finish(thisQuote, '/apex/myCustomPage')

Cancel Method

Example:

Cancels the current instance of the quote wizard, deletes the quote and all related objects, and redirects to the Detail page of the opportunity object associated with this quote:

zqu.QuoteWizardManager.cancel('/' + thisOpportunity.Id)

QuoteWizardManager Metadata Access Methods

The following global methods are used to access metadata associated with the quote wizard configuration.

Method Input Parameter Return Type Description
getQuoteWizardSteps String SubscriptionType static List<zqu__QuoteWizardStep__c> Returns all QuoteWizardStep__c SObjects for the specified subscription type.

The input parameter, SubscriptionType, is required. Valid values are:

  • "New Subscription"
  • "Amend Subscription"
  • "Renew Subscription"
  • "Cancel Subscription"
getBackButtonText   static String Retrieves the text value for the back button of the current step. If called outside of the quote wizard, this method returns null.
getBackButtonText   static String Retrieves the text value for the next button of the current step. If called outside of the quote wizard, this method returns null.
Last modified

Tags

This page has no custom tags.

Classifications

(not set)