Provide ability to search new (client side) and existing (server side) records in reference field lookup

  • 2
  • Idea
  • Updated 2 years ago
  • Under Consideration
This stems from the issue at https://community.skuid.com/skuid/topics/choose-a-lookup-field-value-from-new-records-that-exist-in-... and specifically Ben's post at https://community.skuid.com/skuid/topics/choose-a-lookup-field-value-from-new-records-that-exist-in-....

Use Case: Model 'B' has two fields that are lookups to 'A' & 'Z' respectively.  The user can create new records in 'A' and 'Z' on the same page that records in 'B' are being created.  Multiple model 'B' records can reference the same 'A' and/or 'Z' records.  The user needs the ability to search for field values on 'B' record for records that exist in 'A' (or 'Z') either in the client (unsaved) or database (existing records).

Currently, reference fields only support "searching" for existing records.  Table filters have "manual" sources which provide some pieces of this.  Unfortunately, the "manual" modes must already be loaded in order for the records to appear as options in the filter (which is not ideal when dataset is large).  For the use case above, when a user types a search criteria (or clicks the lookup icon), the client side and server side records should be searched real-time in order to produce the list of matching results.

To demonstrate, in the sample page below, the user would be able to create a new 'Parents' record and then in the 'Accounts' table, type in a search criteria that would produce search results of the combined client side rows with existing records in the database.  Multiple 'Accounts' could point to the same 'Parent'.  Please note, the sample page is not fully vetted and has a few issues - that said, it provides the context for this enhancement request.

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Account">   <models>
         <fields>
            <field id="Id"/>
            <field id="Name"/>
         </fields>
         <conditions/>
         <actions/>
      </model>
      <model id="Account" limit="1" query="false" createrowifnonefound="false" sobject="Account" adapter="" type="" doclone="" processonclient="true">
         <fields>
            <field id="Name"/>
            <field id="CreatedDate"/>
            <field id="ParentId"/>
            <field id="Parent.Name"/>
         </fields>
         <conditions/>
         <actions/>
      </model>
   </models>
   <components>
      <pagetitle model="Account" uniqueid="sk-3hldwl-68">
         <maintitle>
            <template>{{Name}}</template>
         </maintitle>
         <subtitle>
            <template>{{Model.label}}</template>
         </subtitle>
         <actions>
            <action type="multi" label="Save" icon="sk-icon-save">
               <actions>
                  <action type="save" rollbackonanyerror="true">
                     <models>
                        <model>Parents</model>
                        <model>Account</model>
                     </models>
                  </action>
               </actions>
            </action>
            <action type="multi" label="Cancel" icon="sk-icon-cancel">
               <actions>
                  <action type="cancel">
                     <models>
                        <model>Parents</model>
                        <model>Account</model>
                     </models>
                  </action>
               </actions>
            </action>
         </actions>
      </pagetitle>
      <richtext multiple="false" uniqueid="sk-3jplPA-112">
         <contents>&lt;p&gt;&lt;span style="font-size:16px;"&gt;&lt;strong&gt;Parents&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
</contents>
      </richtext>
      <skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="false" showexportbuttons="false" pagesize="10" createrecords="true" model="Parents" buttonposition="" mode="read" uniqueid="sk-3jpNz8-257" emptysearchbehavior="query">
         <fields>
            <field id="Name"/>
         </fields>
         <rowactions>
            <action type="edit"/>
            <action type="delete"/>
         </rowactions>
         <massactions usefirstitemasdefault="true">
            <action type="massupdate"/>
            <action type="massdelete"/>
         </massactions>
         <views>
            <view type="standard"/>
         </views>
         <searchfields/>
      </skootable>
      <richtext multiple="false" uniqueid="sk-3jpvOl-141">
         <contents>&lt;p&gt;&lt;span style="font-size:16px;"&gt;&lt;strong&gt;Accounts&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
</contents>
      </richtext>
      <skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="false" showexportbuttons="false" pagesize="10" createrecords="true" model="Account" buttonposition="" mode="edit" uniqueid="sk-3jnk12-91" emptysearchbehavior="query">
         <fields>
            <field id="Name"/>
            <field id="ParentId" valuehalign="" type=""/>
         </fields>
         <rowactions>
            <action type="edit"/>
            <action type="delete"/>
         </rowactions>
         <massactions usefirstitemasdefault="true"/>
         <views>
            <view type="standard"/>
         </views>
         <actions defaultlabel="Global Actions" defaulticon="sk-icon-magic" usefirstitemasdefault="true">
            <action type="multi" label="Create New Parent" icon="sk-icon-magic">
               <actions>
                  <action type="createRow" model="Parents" appendorprepend="prepend" defaultmodefornewitems="edit"/>
                  <action type="showPopup">
                     <popup title="New Popup" width="90%">
                        <components>
                           <pagetitle model="Parents" uniqueid="sk-3joZPA-217">
                              <maintitle>
                                 <template>{{Name}}</template>
                              </maintitle>
                              <subtitle>
                                 <template>{{Model.label}}</template>
                              </subtitle>
                              <actions>
                                 <action type="multi" label="Add Parent">
                                    <actions>
                                       <action type="closeTopmostPopup"/>
                                    </actions>
                                 </action>
                              </actions>
                           </pagetitle>
                           <basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="Parents" buttonposition="" uniqueid="sk-3joR8Q-192" mode="edit">
                              <columns>
                                 <column width="100%">
                                    <sections>
                                       <section title="Section A" collapsible="no" showheader="false">
                                          <fields>
                                             <field id="Name"/>
                                          </fields>
                                       </section>
                                    </sections>
                                 </column>
                              </columns>
                           </basicfieldeditor>
                        </components>
                     </popup>
                  </action>
               </actions>
            </action>
         </actions>
         <searchfields/>
      </skootable>
   </components>
   <resources>
      <labels/>
      <css/>
      <javascript/>
   </resources>
   <styles>
      <styleitem type="background" bgtype="none"/>
   </styles>
</skuidpage>
      <model id="Parents" limit="20" query="false" createrowifnonefound="false" adapter="" type="" sobject="Account" doclone="" processonclient="true">
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 2 years ago

  • 2
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,210 Points 5k badge 2x thumb
Barry~

Thanks for the suggestion! Vote it up so the devs know how important this is as they consider ideas for a future release. 

Thanks! 
Karen