How to add a button on Contact look up search layout in skuid ?

  • 1
  • Question
  • Updated 3 years ago
I have a skuid page for creating cases and there is a contact lookup field on the page. When i click the contact lookup,  a layout with a list of contacts is displayed. My issue here is, if i don't find certain contact that i am looking for then i want to create a new contact by having a button on the same window. IF there is way to have a button here, then ill Add my Case Create page to the Button created on the Lookup window. 
Is there anyway to accomplish this task?
Photo of Avinash

Avinash

  • 1,726 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matthias

Matthias

  • 628 Points 500 badge 2x thumb
Hello Avinash

Thanks to the powerful Templatefield for Fieldeditor it's pretty easy to do so. If you use a Fieldeditor to create the new Record and use a Template Field for the input of your Contact, you can build a custom Popup for your functionality.

I made a quick example to show you how to start
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true">
   <models>
      <model id="Case" limit="1" query="true" createrowifnonefound="false" adapter="" type="" sobject="Case">
         <fields>
            <field id="ContactId"/>
            <field id="Contact.Name"/>
         </fields>
         <conditions/>
         <actions/>
      </model>
      <model id="Contact" limit="20" query="true" createrowifnonefound="false" adapter="" type="" sobject="Contact">
         <fields>
            <field id="Name"/>
         </fields>
         <conditions/>
         <actions/>
      </model>
   </models>
   <components>
      <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="Case" buttonposition="" uniqueid="sk-LCAcB-225" mode="edit">
         <columns>
            <column width="100%">
               <sections>
                  <section title="Section A" collapsible="no">
                     <fields>
                        <field type="COMBO" valuehalign="" editmodebehavior="custompopup">
                           <label>Template Field</label>
                           <template>{{ContactId}} &lt;div class="ui-icon ui-icon-search nx-field-reference-search" style="cursor: pointer;"&gt;&lt;/div&gt;</template>
                           <editmodepopup title="Template Field" width="450">
                              <components>
                                 <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Contact" buttonposition="" mode="read" uniqueid="sk-LCd-m-276">
                                    <fields>
                                       <field id="Name"/>
                                    </fields>
                                    <rowactions>
                                       <action type="edit"/>
                                       <action type="delete"/>
                                       <action type="multi" label="Apply" icon="sk-icon-magic">
                                          <actions>
                                             <action type="updateRow" fieldmodel="Case" field="ContactId" enclosevalueinquotes="true" value="{{Id}}"/>
                                          </actions>
                                       </action>
                                    </rowactions>
                                    <massactions usefirstitemasdefault="true">
                                       <action type="massupdate"/>
                                       <action type="massdelete"/>
                                    </massactions>
                                    <views>
                                       <view type="standard"/>
                                    </views>
                                 </skootable>
                              </components>
                           </editmodepopup>
                        </field>
                     </fields>
                  </section>
               </sections>
            </column>
         </columns>
      </basicfieldeditor>
   </components>
   <resources>
      <labels/>
      <javascript/>
      <css/>
   </resources>
   <styles>
      <styleitem type="background" bgtype="none"/>
   </styles>
</skuidpage>
 
(Edited)