When a search field used “Option Source Model” and specifies a Display Template that contains a UI Only Field, on initial display no value is displayed. If you edit the field value and select another value, the display template renders correctly.
This one is a little chicken/eggy because on initial load, Contact row comes from SFDC while subsequent lookups come through the Skuid model. That said, if UI Only Fields are supported when Option Source is model, there must be a way to display the field correct only initial display as well.
Steps to reproduce:
- Create page using XML below
- Preview page picking a contact
Expected Behavior
Account Id should display “UI Only Field From Account”
Actual Behavior
Account Id displays blank (the Id field does have a value but the UI only field does not)
- Change the account Id field to something else
Expected Behavior = Actual Behavior
Account Id displays “UI Only FIeld From Account”
Sample XML
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Contact"> <models>
<model id="Account" limit="" query="true" createrowifnonefound="false" adapter="" type="" sobject="Account" doclone="no" processonclient="true">
<fields>
<field id="Name"/>
<field id="Id"/>
<field id="UIOnlyFieldFromAccount" uionly="true" displaytype="FORMULA" label="UI Only Field From Account" readonly="true" returntype="TEXT">
<formula>"UI Only Field From Account"</formula>
</field>
</fields>
<conditions/>
<actions/>
</model>
<model id="Contact" limit="1" query="true" createrowifnonefound="false" sobject="Contact" adapter="" type="">
<fields>
<field id="FirstName"/>
<field id="LastName"/>
<field id="CreatedDate"/>
<field id="UIOnlyFieldFromContact" uionly="true" displaytype="FORMULA" label="UI Only Field From Contact" readonly="true" returntype="TEXT">
<formula>"UI Only Field From Contact"</formula>
</field>
<field id="AccountId"/>
<field id="Account.Name"/>
</fields>
<conditions>
<condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
</conditions>
<actions/>
</model>
</models>
<components>
<pagetitle model="Contact" uniqueid="sk-3I6NI6-71">
<maintitle>
<template>{{FirstName}} {{LastName}}</template>
</maintitle>
<subtitle>
<template>{{Model.label}}</template>
</subtitle>
<actions>
<action type="delete"/>
<action type="clone"/>
<action type="share"/>
<action type="savecancel" window="self"/>
</actions>
</pagetitle>
<basicfieldeditor showsavecancel="false" showheader="true" model="Contact" mode="read" uniqueid="sk-3I6NI7-72">
<columns>
<column width="50%">
<sections>
<section title="Basics" collapsible="no">
<fields>
<field id="FirstName"/>
<field id="LastName"/>
<field id="AccountId" valuehalign="" type="" optionsource="model" optionmodel="Account" displaytemplate="{{UIOnlyFieldFromAccount}}" searchtemplate="{{UIOnlyFieldFromAccount}}">
<searchfields/>
</field>
</fields>
</section>
</sections>
</column>
<column width="50%">
<sections>
<section title="System Info">
<fields>
<field id="CreatedDate"/>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>