Search Component Behavior

  • 2
  • Question
  • Updated 3 years ago
  • Answered
I am using a search component in a new area of my customer community, but I've got some issues that I need to resolve before I can release it.

My customer profile has access to all the records in this case (a Quotes custom object) but I want to restrict the quotes they can see using a field called Agent_Shared__c = TRUE and not display to them the FALSE ones.

For testing, I build a model and placed a table on my page with the same condition (Agent_Shared__c = TRUE.)  Logged in as a community users, I correctly see 3 records.


My search component is setup to query this one Quotes object, and return the Name of the quote, ID and related Account.Name.


I get the ID so that my select action just redirects to the /{{Id}} page.

To accomplish the condition on the Search for Agent_Shared__c = TRUE, I added it to the xml, like this:

<search uniqueid="sk-1CUn52-528" soslfields="All Fields" placeholdertext="Search Quote" boxwidth="300" cssclass="nx-field">                                                   
   <objects>
      <object id="BigMachines__Quote__c" displaytemplate="{{Name}} - {{BigMachines__Account__r.Name}}">
             <fields>
                     <field id="BigMachines__Account__r.Name"/>
                     <field id="Name"/>
                     <field id="Id"/>
              </fields>
              <conditions>
                        <condition type="fieldvalue" field="Agent_Shared__c" operator="=" value="true" enclosevalueinquotes="false"/>
               </conditions>
        </object>
    </objects>
    <selectactions>
               <action type="redirect" window="blank" url="/{{Id}}"/>
     </selectactions>
      <resultactions/>
      <focushotkeys/>
</search>

Issue 1: The results list doesn't return the expected results:


Issue 2:
When clicking the "View", the pop up shows ALL the quotes and doesn't respect the Share_Agent__c = TRUE condition at all.  And, the table has the ugly ID in it, which I don't want my customers to see.

Can these issues be fixed, or should I bail on the search component in my community for now??

Chanrda
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb

Posted 3 years ago

  • 2
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb
bumping back up in hopes there is a cure.  As of now, internally we are planning on removing all the search components... 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
The search component does not currently allow you to specify conditions on what is displayed in the drop down or in the resulting popup page.  Sorry. 
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb
Thanks for the reply, Rob.  Is there a hack to hide the "view" link on the search component?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
You might be able to override the class that shows "view"  with css " display: hidden; "    I can't say I've tried that though.  
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,470 Points 10k badge 2x thumb
I think the css would be..

.sk-search-result-header>.sk-view-link, .sk-search-result-header>a.sk-view-link {
   display: none;
}