can i 'UI Only field' from one model as 'filter condition' in another model ?

  • 2
  • Problem
  • Updated 3 years ago
  • In Progress
I have been trying to use UI Only field in another model on 'filterable condition'. But, i'm getting error saying, i haven't included that UI Only field in the source model, which is not right 

In this i'm trying to load a Opportunity Model based on 'UI only' field in another Opportunity Model

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Opportunity">    <models>
        <model id="Opportunity" limit="100" query="true" createrowifnonefound="false" sobject="Opportunity" type="" datasource="salesforce">
                <field id="Name"/>
                <field id="CreatedDate"/>
                <field id="AccountId"/>
                <field id="Account.Name"/>
                <field id="Account.Description"/>
                <field id="Account.AccountNumber"/>
                <field id="OppFirstName" uionly="true" displaytype="FORMULA" ogdisplaytype="TEXT" readonly="true" returntype="TEXT">
                    <formula>LEFT({{Name}}, 10)</formula>
        <model id="AnotherOpportunity" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="Opportunity">
                <condition type="modelmerge" value="" field="Name" operator="starts with" model="Opportunity" enclosevalueinquotes="true" mergefield="OppFirstName" novaluebehavior="deactivate"/>
        <pagetitle model="Opportunity" uniqueid="sk-39TG_-76">
                <action type="savecancel"/>
        <skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Opportunity" mode="read" uniqueid="sk-39TG_-77">
                <field id="Name" allowordering="true"/>
                <field id="CreatedDate" allowordering="true"/>
                <field id="AccountId" valuehalign="" type="" optionsource="" displaytemplate="{{Name}}{{#Description}}-{{Description}}{{/Description}}" searchtemplate="{{Name}}-{{AccountNumber}}">
                <action type="edit"/>
                <action type="delete"/>
            <massactions usefirstitemasdefault="true">
                <action type="massupdate"/>
                <action type="massdelete"/>
                <view type="standard"/>
        <styleitem type="background" bgtype="none"/>
Photo of Nepz Solutions

Nepz Solutions

  • 442 Points 250 badge 2x thumb

Posted 3 years ago

  • 2
Photo of Chandra V

Chandra V, Champion

  • 7,720 Points 5k badge 2x thumb
I've seen this come up before, and found this thread:

Basically, UI fields shouldn't be used as model conditions.  You could create a formula field on your Opp object that grabs the first 10 letters and use that instead on your 2nd model condition.
Photo of Stephen Sells

Stephen Sells, Alum

  • 17,326 Points 10k badge 2x thumb

Did Chandra V solve your problem?
Photo of Nepz Solutions

Nepz Solutions

  • 442 Points 250 badge 2x thumb
No Stephen.. My question was not answered. I think it's been misunderstood.

I'm not asking about using a UI-Only field for conditions. As i can understand, its not possible as the conditions will be converted directly to SOQL which doesn't know anything about UI only field.

But, my question is that why can't a Model have a condition whose value is based on UI-Only field on another Model. For example, please use my Page XML posted in my earlier post.