Millau upgrade 11.2.9 - skuid.sfdc.search API not working

  • 1
  • Problem
  • Updated 1 month ago
Raw SOSL generated: searchResult.sosl returns null.


<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
    <models/>
    <components>
        <buttonset uniqueid="sk-r5E-253">
            <buttons>
                <button type="multi" label="New Button" uniqueid="sk-r5E-259">
                    <actions>
                        <action type="custom" snippet="test"/>
                    </actions>
                </button>
            </buttons>
        </buttonset>
    </components>
    <resources>
        <labels/>
        <javascript>
            <jsitem location="inlinesnippet" name="test" cachelocation="false">var params = arguments[0],
$ = skuid.$, queryText = 'abc';

// Perform our SOSL Search
$.when(skuid.sfdc.search({
    query: queryText,
    searching: "ALL FIELDS",
    returning: [
       { "objectName": "Account", "fields": ["Name","CreatedDate"] },
       { "objectName": "Contact", "fields": ["FirstName","LastName","CreatedDate"] }
    ]
})).done(function(searchResult){
    $.each(searchResult.results,function(i,sobjectResult){
        var objectName = sobjectResult.objectName;
        var records = sobjectResult.records;
        console.log('* Found ' + records.length + ' ' + objectName + ' records');
        $.each(records,function(j,record){
            if (objectName==='Contact') {
                console.log('Found Contact: ' + record.FirstName + ' ' + record.LastName);
            }
            else console.log('Found Account: ' + record.Name);
        });
    });
}).fail(function(searchResult){
    console.error('Search failed: ' + searchResult.error);
}).always(function(searchResult){
   console.log('Raw SOSL generated: ' + searchResult.sosl);
    console.log('Original search request');
    console.log(searchResult.request);
});</jsitem>
        </javascript>
        <css/>
        <actionsequences/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>

Photo of jili@heidrick.com

jili@heidrick.com

  • 2,032 Points 2k badge 2x thumb

Posted 1 month ago

  • 1
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,032 Points 2k badge 2x thumb
Hi is skuid.sfdc.search API still supported in 11.2.9? The above example from Skuid documentation no longer works. Can you please advise?
Photo of Gregg Baxter

Gregg Baxter, Official Rep

  • 3,080 Points 3k badge 2x thumb
Hi Jili

Can you perhaps explain your use case here please?

The Search component is quite powerful and I have created a page for you that has similar functionality.

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
    <models>
<model id="ContsModel" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Contact">
    <fields>
        <field id="Id"/>
        <field id="FirstName"/>
        <field id="LastName"/>
        <field id="CreatedDate"/>
        <field id="AccountId"/>
        <field id="Account.Name"/>
    </fields>
    <conditions>
        <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="FirstName" operator="=" state="filterableoff" inactive="true" name="FirstName"/>
        <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="LastName" state="filterableoff" inactive="true" name="LastName"/>
    </conditions>
    <actions/>
</model>
<model id="AccsMod" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Account">
    <fields>
        <field id="Id"/>
        <field id="Name"/>
        <field id="CreatedDate"/>
    </fields>
    <conditions>
        <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="Name" state="filterableoff" inactive="true" name="Name"/>
    </conditions>
    <actions/>
</model>
</models>
    <components>
        <grid uniqueid="sk-1YXp-906">
<divisions>
    <division behavior="flex" minwidth="100px" ratio="1">
        <components/>
    </division>
    <division behavior="flex" verticalalign="top" minwidth="100px" ratio="1">
        <components>
            <search uniqueid="sk-1YV7-313" soslfields="Name Fields">
                <resultactions/>
                <focushotkeys/>
                <objects>
                    <object datasource="salesforce" id="Account" fields="CreatedDate" displaytemplate="{{Name}}" icon="sk-icon-assets">
                        <fields>
                            <field id="Name"/>
                            <field id="CreatedDate"/>
                        </fields>
                        <resultactions>
                            <action label="Set" icon="sk-icon-assets">
                                <actions>
                                    <action type="setCondition" model="AccsMod" condition="Name" value="{{Name}}"/>
                                    <action type="requeryModel" model="AccsMod" behavior="standard"/>
                                </actions>
                            </action>
                        </resultactions>
                    </object>
                    <object datasource="salesforce" id="Contact" icon="sk-icon-contact" displaytemplate="{{FirstName}} {{LastName}} " fields="Account.Name">
                        <fields>
                            <field id="FirstName"/>
                            <field id="LastName"/>
                        </fields>
                        <resultactions>
                            <action label="Set" icon="sk-icon-contact">
                                <actions>
                                    <action type="setCondition" model="ContsModel" condition="FirstName" value="{{FirstName}}"/>
                                    <action type="setCondition" model="ContsModel" condition="LastName" value="{{LastName}}"/>
                                    <action type="requeryModel" model="ContsModel" behavior="standard"/>
                                </actions>
                            </action>
                        </resultactions>
                    </object>
                </objects>
                <selectactions/>
            </search>
        </components>
    </division>
</divisions>
<styles>
    <styleitem type="background" bgtype="none"/>
</styles>
</grid>
    <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="ContsModel" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-1YVl-498">
<fields>
    <field id="FirstName" uniqueid="fi-1YVl-500"/>
    <field id="LastName" uniqueid="fi-1YVl-501"/>
    <field id="CreatedDate" uniqueid="fi-1YVl-502"/>
</fields>
<rowactions>
    <action type="edit"/>
    <action type="delete"/>
</rowactions>
<massactions usefirstitemasdefault="true">
    <action type="massupdate"/>
    <action type="massdelete"/>
</massactions>
<views>
    <view type="standard"/>
</views>
</skootable>
<skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="AccsMod" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-1YVm-558">
    <fields>
        <field id="Name" uniqueid="fi-1YVm-560"/>
        <field id="CreatedDate" uniqueid="fi-1YVm-561"/>
    </fields>
    <rowactions>
        <action type="edit"/>
        <action type="delete"/>
    </rowactions>
    <massactions usefirstitemasdefault="true">
        <action type="massupdate"/>
        <action type="massdelete"/>
    </massactions>
    <views>
        <view type="standard"/>
    </views>
</skootable>
</components>
    <resources>
        <labels/>
        <javascript>
            
        </javascript>
        <css/>
        <actionsequences uniqueid="sk-1YUp-247"/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>
Photo of jili@heidrick.com

jili@heidrick.com

  • 2,032 Points 2k badge 2x thumb
Thanks! Yes we've had similar implementations. Our use case is to allow free text to be selected as a value if no company is found. We do not want to force create an account record in the system for previous work experience for instance.