Lookup search template behavior for standard vs custom relationship fields

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
Hi,

We have a opportunity creation wizard and we use couple of lookup fields on Account object, out of which, one is standard AccountId field and other is a custom field. 

We have an external id field (Account Search Helper) on Account which we are trying to leverage to search for data. Now, when i have search as well as display template as Account Search Helper field, even though results are returned, the data for standard account field is not returned. when i change search and display template to Name, then data is displayed. So here i am also not sure if our external id field works in fetching results or not. This problem occurs for only standard account field and not custom one.

here is the code:
<skuidpage unsavedchangeswarning="" showsidebar="false" showheader="false" tabtooverride="Opportunity" theme="Modern" personalizationmode="server">   <models>
      <model id="RecordType" limit="1" query="true" createrowifnonefound="false" sobject="RecordType" doclone="" type="">
         <fields/>
         <conditions>
            <condition type="fieldvalue" value="Target" enclosevalueinquotes="true" field="DeveloperName"/>
            <condition type="fieldvalue" value="Opportunity" enclosevalueinquotes="true" field="SobjectType"/>
         </conditions>
         <actions/>
      </model>
      <model id="Opportunity" limit="1" query="false" createrowifnonefound="true" sobject="Opportunity" type="" adapter="">
         <fields>
            <field id="AccountId"/>
            <field id="Account.Name"/>
            <field id="Name"/>
            <field id="DBG_Broker__c"/>
            <field id="DBG_Broker__r.Name"/>
            <field id="CloseDate"/>
            <field id="Amount"/>
            <field id="StageName"/>
            <field id="DBG_Broker__r.Account_Search_Helper__c"/>
            <field id="Account.Account_Search_Helper__c"/>
         </fields>
         <conditions>
            <condition type="modelmerge" value="" field="RecordTypeId" operator="=" model="RecordType" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="deactivate"/>
            <condition type="fieldvalue" value="Target" enclosevalueinquotes="true" field="StageName" state=""/>
            <condition type="fieldvalue" value="TODAY" enclosevalueinquotes="false" field="CloseDate"/>
         </conditions>
         <actions/>
      </model>
   </models>
   <components>
      <panelset type="standard" cssclass="mask" scroll="" uniqueid="sk-sNpWI-153">
         <panels>
            <panel>
               <components>
                  <wizard deferstepcontentsrendering="true" cssclass="" uniqueid="targetWizard">
                     <steps>
                        <step stepid="step1" steplabel="Create Target">
                           <components>
                              <pagetitle model="Opportunity" uniqueid="sk-sNpWI-154">
                                 <actions>
                                    <action type="multi" label="Save &amp; Finish" icon="fa-check">
                                       <actions>
                                          <action type="save" rollbackonanyerror="true">
                                             <models>
                                                <model>Opportunity</model>
                                                <model>TargetCampaignInfluence</model>
                                             </models>
                                          </action>
                                       </actions>
                                    </action>
                                 </actions>
                              </pagetitle>
                              <basicfieldeditor showheader="true" showsavecancel="false" model="Opportunity" buttonposition="" mode="edit" layout="" uniqueid="sk-sNpWI-155">
                                 <columns layoutmode="fixed">
                                    <column width="50%">
                                       <sections>
                                          <section title="General Information" collapsible="no">
                                             <fields>
                                                <columns layoutmode="fixed">
                                                   <column width="100%">
                                                      <sections>
                                                         <section title="New Section" collapsible="no" showheader="false">
                                                            <fields>
                                                               <field id="Name" valuehalign="" type="">
                                                                  <label>Target Name</label>
                                                               </field>
                                                               <field id="AccountId" showhelp="true" valuehalign="" type="" required="true" optionsource="" displaytemplate="{{Account_Search_Helper__c}}" searchtemplate="{{Account_Search_Helper__c}}" tokenizesearch="true">
                                                                  <label>Client</label>
                                                                  <filters>
                                                                     <filter type="fieldvalue" operator="=" enclosevalueinquotes="true" field="RecordType.DeveloperName" value="Account"/>
                                                                  </filters>
                                                                  <searchfields usesosl="true" soslfields="Sidebar Fields"/>
                                                                  <renderconditions logictype="and" onhidedatabehavior="keep"/>
                                                                  <enableconditions logictype="and"/>
                                                               </field>
                                                               <field id="DBG_Broker__c" showhelp="true" valuehalign="" type="" required="true" optionsource="" displaytemplate="{{Account_Search_Helper__c}}" searchtemplate="{{Account_Search_Helper__c}}" tokenizesearch="true">
                                                                  <label>Producer</label>
                                                                  <filters>
                                                                     <filter type="fieldvalue" operator="=" enclosevalueinquotes="true" field="RecordType.DeveloperName" value="Broker"/>
                                                                  </filters>
                                                                  <searchfields usesosl="true" soslfields="Sidebar Fields"/>
                                                                  <renderconditions logictype="and" onhidedatabehavior="keep"/>
                                                                  <enableconditions logictype="and"/>
                                                               </field>
                                                            </fields>
                                                         </section>
                                                      </sections>
                                                   </column>
                                                </columns>
                                             </fields>
                                          </section>
                                       </sections>
                                    </column>
                                    <column width="50%">
                                       <sections>
                                          <section title="Target Detail" collapsible="no">
                                             <fields>
                                                <columns>
                                                   <column width="100%">
                                                      <sections>
                                                         <section title="New Section" collapsible="no" showheader="false">
                                                            <fields>
                                                               <field id="Amount" showhelp="true" decimalplaces="" valuehalign="" type=""/>
                                                               <field id="CloseDate" showhelp="true" valuehalign="" type=""/>
                                                            </fields>
                                                         </section>
                                                      </sections>
                                                   </column>
                                                </columns>
                                             </fields>
                                          </section>
                                       </sections>
                                    </column>
                                 </columns>
                              </basicfieldeditor>
                           </components>
                           <actions/>
                        </step>
                     </steps>
                  </wizard>
               </components>
            </panel>
         </panels>
      </panelset>
   </components>
   <resources>
      <labels/>
      <javascript/>
      <css>
         <cssitem location="inline" name="styles" cachelocation="false">.mask {
    width: 1024px;
}</cssitem>
         <cssitem location="inline" name="productSectionWidth" cachelocation="false">#productSectionId {
    width:50%;
}</cssitem>
      </css>
   </resources>
   <styles>
      <styleitem type="background" bgtype="none"/>
   </styles>
</skuidpage>


Some pointers:
tokenized search, SOSL search are enabled. For search fields, we are using Sidebar option from dropdown.

is there an issue the way the search works in case of standard relationship fields?
Photo of Sunny Sharma

Sunny Sharma

  • 678 Points 500 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
Hi, Sunny,
I tried to reproduce your issue and wasn't able to reproduce any kind of problem. When you say "the data for standard account field is not returned", are you saying that, when typing a value into the autocomplete field, the external Id field values do not show in the dropdown of lookup results (as in, an empty dropdown)? Or does no dropdown display at all? I used your xml and made a couple of changes:
  1. Changed the search template and display template to use our own custom external id field.
  2. Changed the lookup filter on the AccountId field to use a record type DeveloperName from our own org.
Here is what I got when trying to search on the external Id field:




I would check the permissions on your external Id field. Is it possible that your users aren't given permission to view the external Id field?
Emily
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
Hi, Sunny,
If you don't mind giving Skuid login access to your org, that would be fantastic! Then I can go in and take a look.
Thanks!
Emily
Photo of Sunny Sharma

Sunny Sharma

  • 678 Points 500 badge 2x thumb
Hi Emily,

Login access provided for 3 days. Page testPage
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
Sunny,
I think you uncovered a bug in Skuid. It was tough to find, but it looks like the issue is caused by the external id field (Account_Search_Helper__c) having the word "Account" (e.g. the same name as the field related to the Opportunity) in the field name. We have a bug fix planned to go out in our next patch, but until then, your workaround would be to change the name of the external id field to NOT include the object name (e.g. "Account") in the field name. I hope this is a feasible workaround for the time being.
Let me know if that makes sense.
Emily
Photo of Sunny Sharma

Sunny Sharma

  • 678 Points 500 badge 2x thumb
Thanks Emily for your response. Another thing. We have another child object of Account where field api name is DBG_Account__c, for that it works. Is it that wherever the relationship name is Account, this will not work and we have to wait for bug fix?
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
Sure! Actually, it looks like the issue occurs when the field api name begins with "Account". It looks like somehow Skuid was cutting off "Account" from the beginning of "Account_Search_Helper__c" when performing the search. So, for objects where the relationship namebegins with "Account", you will have to either change the relationship name or wait for the bug fix.
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Hi~

This issue has been resolved in Update 7 and is available now from the Skuid Releases page: http://www.skuidify.com/skuidreleases.

Thanks!
Karen