Hello -
When a reference field filter is marked to filter results based on value in another model and set to ‘Abort query’ if no data in source model, the condition is being ignored and all results are being returned.
Steps to Reproduce:
- Create Contact ‘New’ page
- Add two models:
a) AccountEmpty - Based on Account, contains Id & Name and is NOT marked to load data or create new
b) AccountFull - Based on Account, contains Id & Name and is marked to load data with max records of 1 - Add AccountId to contact model
- Add Account field to Contact Field Editor setting filter to Account Id in AccountEmpty Id and abort if no data
- Add a second Account field to Contact Field Editor setting filter to Account Id in AccountFull Id
- Preview page
- Click magnifying glass on “AccountEmpty” field
Actual Result
All Accounts are returned
Expected Result
No records should be returned
- Click magnifying glass on “AccountFull” field
Actual Result = Expected Result
Only contacts from the account that was loaded are displayed
Sample Page XML
<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Contact"> <models>
<model id="AccountEmpty" limit="" query="false" createrowifnonefound="false" sobject="Account" doclone="no" type="">
<fields>
<field id="Id"/>
<field id="Name"/>
</fields>
<conditions/>
<actions/>
</model>
<model id="AccountFull" limit="1" query="true" createrowifnonefound="false" sobject="Account" doclone="no" type="">
<fields>
<field id="Id"/>
<field id="Name"/>
</fields>
<conditions/>
<actions/>
</model>
<model id="Contact" limit="1" query="false" createrowifnonefound="true" sobject="Contact">
<fields>
<field id="FirstName"/>
<field id="LastName"/>
<field id="AccountId"/>
<field id="Account.Name"/>
<field id="Account.Id"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<components>
<basicfieldeditor showsavecancel="false" showheader="true" model="Contact" mode="edit" buttonposition="" layout="">
<columns>
<column width="100%">
<sections>
<section title="Basics" collapsible="no">
<fields>
<field id="AccountId" valuehalign="" type="">
<label>Account From Empty</label>
<filters>
<filter type="modelmerge" operator="in" field="Id" value="" model="AccountEmpty" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
</filters>
</field>
<field id="AccountId" valuehalign="" type="">
<label>Account From Full</label>
<filters>
<filter type="modelmerge" operator="in" field="Id" value="" model="AccountFull" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="noquery"/>
</filters>
<renderconditions logictype="and" onhidedatabehavior="keep"/>
</field>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
</skuidpage>
Thank you!