Get Category Details Action

Get details of a category record.

This action is available in API version 64.0 and later.

You can invoke this action via Apex and Flows only.

Special Access Rules 

The Get Category Details action is available in Enterprise, Unlimited, and Developer Editions where Product Discovery is enabled.

Inputs 

InputTypeDescription
additionalContextDataApex-definedCollection of Apex runtime_industries_cpq.AdditionalContextData records that contain additional context data for nodes of the custom context definition, if applicable. You can add details for up to 10 nodes.
catalogIdstringID of the catalog record that’s used to search for products within a category.
categoryIdstringRequired. ID of the category or subcategory that’s used to search for products.
contextDefinitionNamestringName of the custom context definition that’s used to create context data for categories. If null, the default context definition is used.
contextMappingNamestringName of the context mapping. By default, the default context mapping associated with the context definition is used.
correlationIdstringUnique identifier attached to requests and messages, allowing reference to a specific transaction or event chain.
enableQualificationProcedurebooleanIndicates whether qualification rules are applied to categories ( tru e) or not ( false ).
filterInputRepresentationApex-definedCollection of Apex runtime_industries_cpq.FilterInputRepresentation records that contain the filter criteria applied to the category records.
qualificationProcedureNamestringName of the custom qualification procedure that’s executed to determine the category list. If null, the default qualification procedure is executed.
userContextInputRepresentationApex-definedAn Apex UserContextInputRepresentation record that contains user details, such as account ID, geographical location, language preferences, and more.

Outputs 

OutputTypeDescription
apiStatusOutputRepresentationApex-definedAn Apex runtime_industries_cpq.ApiStatusRepresentation record that contains the status of the request, including the status code and message.
categoryDetailsRepresentationsApex-definedCollection of Apex CategoryDetailsRepresentation records that contain details about the retrieved category.
correlationIdstringUnique identifier attached to requests and messages, allowing reference to a specific transaction or event chain.

Example 

Here’s a sample input to call this invocable action from Apex code.

1Invocable.Action action = Invocable.Action.createStandardAction('getCategoryDetails');
2
3ConnectApi.UserContextInputRepresentation userContext = new ConnectApi.UserContextInputRepresentation();
4userContext.accountId = '001xx000003GYiEAAW';
5
6runtime_industries_cpq.ContextDataInput data = new runtime_industries_cpq.ContextDataInput();
7String nodeNameVal = 'Quote__c';
8Map<String,Object> nodeDataVal = new Map<String,Object>();
9nodeDataVal.put('id',(Object)'0Q0xx0000004CDsCAM');
10nodeDataVal.put('businessObjectType',(Object)'Quote');
11data.nodeName = nodeNameVal;
12data.nodeData = nodeDataVal;
13List<runtime_industries_cpq.ContextDataInput> contextData= new List<runtime_industries_cpq.ContextDataInput>();
14contextData.add(data);
15runtime_industries_cpq.AdditionalContextData additionalContextDataOut = new runtime_industries_cpq.AdditionalContextData();
16additionalContextDataOut.additionalContextData = new List<runtime_industries_cpq.ContextDataInput>();
17additionalContextDataOut.additionalContextData.add(data);
18
19action.setInvocationParameter('categoryId', '0ZGxx0000000001GAA');
20action.setInvocationParameter('correlationId', '9cbb9650-48c5-11ed-96d1-0afcf185843b');
21action.setInvocationParameter('userContext', userContext);
22action.setInvocationParameter('enableQualification', True);
23action.setInvocationParameter('qualificationProcedure', 'CatQual02');
24action.setInvocationParameter('contextDefinition', 'CategoryCD');
25action.setInvocationParameter('contextMapping', 'ProductDiscoveryMapping');
26action.setInvocationParameter('additionalContextData', additionalContextDataOut);
27
28List<Invocable.Action.Result> results = action.invoke();
29System.debug('Search Action + '+results);

Here’s a sample response when you call this action.

1{
2  "root": [
3    {
4      "actionName": "getCategoryDetails",
5      "errors": null,
6      "invocationId": null,
7      "isSuccess": true,
8      "outcome": null,
9      "outputValues": {
10        "apiStatusOutputRepresentation": {
11          "statusMessage": null,
12          "statusCode": "FetchedDetailsSuccessfully",
13          "messages": []
14        },
15        "correlationId": "9cbb9650-48c5-11ed-96d1-0afcf185843b",
16        "categoryDetailsRepresentations": {
17          "sortOrder": null,
18          "qualificationContext": {
19            "reason": "Category is not qualified because one or more field(s) do not match the qualification criteria. Fields:- CategoryId - 0ZGxx0000000001GAA quotename - null Max_Number_of_Employees - 1500 Min_Number_of_Employees - 1500",
20            "isQualified": false
21          },
22          "parentCategoryId": null,
23          "name": "Laptops",
24          "isNavigational": true,
25          "id": "0ZGxx0000000001GAA",
26          "hasSubCategories": true,
27          "description": null,
28          "childCategories": [
29            {
30              "sortOrder": null,
31              "qualificationContext": {
32                "reason": null,
33                "isQualified": true
34              },
35              "parentCategoryId": "0ZGxx0000000001GAA",
36              "name": "level1",
37              "isNavigational": true,
38              "id": "0ZGxx000000004rGAA",
39              "hasSubCategories": true,
40              "description": null,
41              "childCategories": [],
42              "catalogId": null
43            }
44          ],
45          "catalogId": "0ZSxx0000000002GAA"
46        }
47      },
48      "sortOrder": -1,
49      "version": 1
50    }
51  ]
52}