Ascendix Search Admin Guide

Custom Button Configuration

Ascendix Search supports adding custom buttons to search results, which can be configured for each searchable object. For Lightning Web Components, see below for additional instructions.

1. Create an Aura Lightning Component
  1. The component should have access equal global
  2. The component should accept the following global parameters:
    <aura:attribute name="sobjectName" type="String" access="global" /> <!-- Object API name -->
    <aura:attribute name="resultRows" type="List" /> <!-- List of displayed results -->
    <aura:attribute name="selectedIds" type="List" /> <!-- List of selected results -->
    <aura:attribute name="query" type="String" access="global" /> <!-- Query used to generate results -->
    <aura:attribute name="buttonLabel" type="String" access="global" /> <!-- Configured button label -->
    <aura:attribute name="enableRule" type="String" access="global" /> <!-- Configured enable rule -->
    <aura:attribute name="isDisabled" type="Boolean" default="false "/> <!-- Indicates if button should be enabled/disabled -->
  3. The component UI should define exactly one button, which can open a modal dialog or perform a custom action:
2. Add button to Ascendix Search configuration
  1. Navigate to Setup -> Custom Settings -> Search Setting
  2. Click the Manage button
  3. Click the New button
    • Name must start with prefix “Search Action” such as “Search Action My Button”
    • Value is an XML string defining the component name, label, enable rule, and supported object. For example:
      <action componentName="MyAuraComponent" label="My Label" enableRule="1"> <obj>Account</obj>
      	<obj>ascendix__Availability__c ascendix__Property__c</obj>
      </action>

      componentName – Aura Lightning Component associated with the action
      label – Action button label
      enableRule

      0 – always enabled
      1 – at least one item is selected
      2 – only one item is selected

      allObjects – (optional) flag if action applies to all object types
      obj – array of object types the action supports (used when allObjects=false or not specified)

  4. Click the Save button

Lightning Web Component (LWC) Considerations

Lightning Web Components cannot be directly displayed in a custom button, but can be displayed inside an Aura Lightning Component used as a wrapper. For example:

<aura:component access="global">
<aura:attribute name="sobjectName" type="String" access="global" />
<aura:attribute name="resultRows" type="List" />
<aura:attribute name="selectedIds" type="List" />
<aura:attribute name="buttonLabel" type="String" access="global" />
<aura:attribute name="enableRule" type="String" access="global" />
<aura:attribute name="isDisabled" type="Boolean" default="false" />

<c:mylwc sobjectName="{!v.sobjectName}" resultRows="{!v.resultRows}" selectedIds="{!v.selectedIds}" buttonLabel="{!v.buttonLabel}" enableRule="{!v.enableRule}" isDisabled="{!v.isDisabled}" />

</aura:component>

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.