Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Show Page Sections

download

Custom Actions in the NEXT STEPS Panel

You can add custom action buttons in the NEXT STEPS panel along with the standard action buttons. You can also configure a rule to show or hide the standard and custom action buttons based on certain criteria.

You need to configure JSON files in the Object Layout for the following purposes:

  • To create custom action buttons to be displayed in the NEXT STEPS panel
  • To configure a rule to show or hide the standard or custom action buttons in the NEXT STEPS panel

Adding Custom Button to the NEXT STEPS Panel

You have configured the required workflow or custom code in the Conga Platform. For more information see, Managing Workflows or Managing Custom Code.

You must provide the configuration for adding a custom action button in JSON format. For more information, see JSON Formats for Custom Actions.
Note: Note that the action button created through the Object Layouts menu apply to all record types. You can make the custom action button applicable to a specific record type, by configuring a rule for the action button. For more details, see Configuring Visibility Rules for Actions in the NEXT Steps.
  1. Click the App Launcher ( ) icon from the top-left corner > Apps > CX Studio.
  2. Click Object Layouts in the navigation menu.
  3. Click Edit Metadata for the record with the following parameter values:
    1. CLM in Application Name.
    2. config in Variant.
    3. detailcontrolbar in Page Type.
    4. Specify the code for the custom action button in the actions{} block in the JSON Editor. For more information, click JSON code format.
      Tip: As an alternative to writing JSON from scratch, you can clone an existing action from the UI, copy its JSON and paste it to the custom action you are creating. To do so, add a custom action button by cloning an existing button in the page header kebab menu, through the Edit Page functionality in CX Studio. A record for the clone action is created in the Object Layout. Open its metadata and copy the JSON format. Open the metadata of the new custom action button and paste the copied JSON. Make required changes to the metadata and save them. This minimizes the risk of errors that can occur when manually writing the JSON format. Once you have added the custom action in the NEXT Step panel through Object Layout configuration, you can delete the cloned custom action created in the page layout to copy the JSON format. For more details, please refer to the screenshots below.
      Figure 1. Optional: Action button cloned to copy its JSON
      Figure 2. Optional: Opening the Object Layout for the cloned action to copy JSON
      Figure 3. Optional: Copying the JSON of the of the cloned action
You have added the custom action button to the NEXT STEPS panel.
You can now configure a rule to show or hide the custom action button from the NEXT STEPS panel, depending on the criteria. For more information, see Configuring Visibility Rules for Actions in the NEXT STEPS panel

JSON Formats for Custom Actions

You can add custom actions in the application by writing code in JSON format. You can add a custom actions in the application to perform either of the following functions:

  • Navigate

  • Execute Workflow

  • Execute Custom CodeExecute Custom Code

This topic explains how you can write code for different action performs by giving examples for JSON for each action function

To configure a custom action button to navigate to Conga’s documentation portal
Note:
  • The values for id, key, and actionFunc must be the same.
  • The value specified for the label is the button label displayed on the UI.
  • In the custom action object, specify the target URL in the params property. Keep the other property values as is.
{ "id": "navigate to doc portal", "key": " navigate to doc portal", "label": "Navigate to Documentation Portal", "actionFunc": "navigate to doc portal", "customAction": { "displayName": "Navigate", "name": "navigate", "actionDef": "function(e){var t;window.location=e.params.url;const r=null===(t=e.CCL)||void 0===t?void 0:t.Translation;return Promise.resolve({Data:{respAction:[{type:\"showMessage\",data:{message:null==r?void 0:r.CUSTOM_ACTION_NAVIGATE_SUCCESS(),messageType:\"success\"}}],data:{}}})}", "source": "ccl", "params": "url:http://documentation.conga.com/" }, "hidden": false, "selected": false },
To configure a custom action button to apply a discount based on the total contract value
Note:
  • The values for id, key, and actionFunc must be the same.
  • The value specified for the label is the button label displayed on the UI.
  • In the custom action object, specify the custom code name in the params property. Keep the other property values as is.
{ "id": "apply tcv based discount", "key": "apply tcv based discount", "label": "Apply TCV Based Discount", "actionFunc": " apply tcv based discount", "customAction": { "displayName": "Execute Custom Code", "name": "executeCustomCode", "actionDef": "async function(e){var t;const r=null===(t=e.CCL)||void 0===t?void 0:t.customCodeService,{resourceName:n,method:i,url:a}=e.params,o={resourceName:n,method:i,requestParam:{...e.context,userInfo:e.userInfo,orgInfo:e.orgInfo},url:a};let s;try{s=await(null==r?void 0:r.executeUri(o))}catch(e){return Promise.reject(e)}return s||{Data:{respAction:[],data:{}}}}", "source": "ccl", "params": "method:post,resourceName:TotalContractValue,url:response" }, "hidden": false, "selected": false },
To configure a custom action button to execute a workflow to send mail to the contract owner.
Note:
  • The values for id, key, and actionFunc must be the same.
  • The value specified for the label is the button label displayed on the UI.
  • In the custom action object, specify the workflow ID in the params property. Keep the other property values as is.
{ "id": "workflow send email", "key": " workflow send email ", "label": "Send Email", "actionFunc": "workflow send email", "customAction": { "displayName": "Execute Workflow", "name": "executeWorkflow", "actionDef": "async function(e){var t,r,i;let a;try{const n=e.params.id,o=null===(t=e.CCL)||void 0===t?void 0:t.HttpService,s={WorkflowDefinitionId:n,InputParams:{ObjectName:\"Agreement\",RecordId:null===(r=e.context)||void 0===r?void 0:r.recordId},Variables:{}},c=`${null===(i=e.CCL)||void 0===i?void 0:i.coreConfigService.getAPIHost()}/api/workflow/v1/actions/ExecuteWorkflow/execute`;a=await(null==o?void 0:o.post(c,s))}catch(e){n.y.info(e)}return{Data:{respAction:a.Data.Actions,data:a.Data.Context}}}", "source": "ccl", "params": "id:5dec1db7-a7c3-4ba9-8aec-e66884fa31cf" } }

Configuring Visibility Rules for Actions in the NEXT STEPS panel

You can configure rules to show or hide the standard and custom action buttons in the NEXT Steps panel based on the criteria.

You have added the action button in the NEXT Steps panel.
You need to specify the id, name, and description for the rule. In the criteria{} block, you need to specify one or more conditions (such status, role, etc) and the logical expression to be applied on the conditions. In the action{} block, you need to specify the value for hidden property for the button as true to hide the button and false to show the button in the action panel.
  1. Click Edit Metadata for the record with the following parameter values:
    1. CLM in Application Name.
    2. config_rule1 in Variant.
    3. detailcontrolbar in Page Type.
  2. In the ruleset{} block in the JSON Editor, specify the code for the rule to hide or show the action button.
    Note: The value of dependentComponentId parameter must match the value of id parameter specified while adding the custom action.
    To hide the Apply TCV Based Discount button when the contract status category and status are In Signatures and Ready for Signatures, respectively, specify:
    { "id": "HideApplyTCVBasedDiscount", "name": "HideApplyTCVBasedDiscount", "description": "Hide Apply TCV Based Discount", "condition": { "criteria": [ { "componentId": "StatusCategory", "componentProperty": "value", "validation": { "logicalOperator": "=", "comparisonValue": "In Signatures", "condition": "ValueMatchesStaticCondition" }, "visible": true, "criteriaFieldSchemaName": "StatusCategory", "type": "Field" }, { "componentId": "Status", "componentProperty": "value", "validation": { "logicalOperator": "=", "comparisonValue": "Ready for Signatures", "condition": "ValueMatchesStaticCondition" }, "visible": true, "criteriaFieldSchemaName": "Status", "type": "Field" } ], "logicalExpression": "( 1 AND 2 )" }, "action": { "invalid": [ { "dependentComponentId": "apply tcv based discount", "property": "hidden", "value": false } ], "valid": [ { "dependentComponentId": "apply tcv based discount", "property": "hidden", "value": true }
  3. Click Save.

You have added rule configuration for the action.

When the contract meets the criteria defined in the rule configuration, the action button is shown or hidden accordingly.