Loading
Get Started with Communications, Media, and Energy & Utilities (CME)...
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          RESTCPQInterface

          RESTCPQInterface

          The RESTCPQInterface builds the command structure from the Representational State Transfer (REST) request, which is in JavaScript Object Notation (JSON) format.

          Type

          Strongly typed

          Triggered When

          The RESTCPQInterface is called in CPQHandler when the system detects a REST call.

          Called In

          The RESTCPQInterface is called in CPQHandler. The fillCommandStruct method is called before any processing is done. Using this method, you can implement almost any command structure, as long as it follows the /services/apexrest/v1/CPQService/* pattern. The pattern allows for an unknown number of folders or resource designators to be appended to the end. The number is probably limited by RFC 7230.

          The fillOutReturn method takes the default return information from the executed methods, and then transforms or augments it to match the desired structure.

          Signature

          Access

          Signature

          global

          List> fillCommandStruct(System.RestRequest req, List> parsed)

          global

          List> fillOutReturn(List> returnData)

          Default Implementation

          The DefaultRESTCPQInterfaceImplementationDefaultRESTCPQInterfaceImplementation is nonoperative. It returns the input as output without modification.

          Other Implementations

          The RESTCPQChangerRESTCPQChanger implementation builds the command structure from the REST request, which is in JSON format. From the command structure, you can get the command that is used in RESTResource.

          Input Parameters

          req

          Type: REST request

          The REST request that the endpoint received from Salesforce. See the Salesforce Apex Developer Guide, RestRequest Class.

          parsed

          Type: List<Map<String, String>>

          List of Price Book Entries processed so far

          returnData

          Type: List<Map<String, String>>

          List of Price Book Entries processed so far

          fillOutReturn

          Type: List<Map<String, Object>>

          Returns the data passed in

          fillCommandStruct

          Type: RESTRequest object and List<Map<String, String>>

          Returns the data passed in

          Output Parameters

          List<Map<String, Object>>

          Command structure for handler

          List<Map<String, String>>

          Data to serialize and return

          Sample Implementation

          global with sharing class DefaultRESTCPQInterfaceImplementation implements GlobalInterfaces.RESTCPQInterface
          {
             global List<Map<string, string>> fillCommandStruct(RestRequest req, List<Map<string, string>> parsed)
             {
                return parsed;
             }
             global List<Map<string, object>> fillOutReturn(List<Map<string, object>> returnData)
             {
                return returnData;
             }
          }
           
          Loading
          Salesforce Help | Article