I have a model on account and I want to filter accounts based on Oppty amount.
Currently there are a lot of associated oppties but I would only need Oppties based on certain Stages and record type.
I tried using UI only model but don’t know how to go about it.
Hi Jaiti, this might be easier if you use a model on Opportunities. That way you can use a model condition for the Stage, you can use filter easily and you are still able to display all the Account information though the Opportunity. I created a simple page with standard objects and fields, hope this is helpful for you:
<skuidpage personalizationmode="server" showsidebar="false" useviewportmeta="true" showheader="false">
<models>
<model id="Opps" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity">
<fields>
<field id="RecordTypeId"/>
<field id="AccountId"/>
<field id="Account.Name"/>
<field id="StageName"/>
<field id="Amount"/>
<field id="Account.Phone"/>
<field id="Account.CreatedDate"/>
</fields>
<conditions>
<condition type="fieldvalue" value="Discovery" field="StageName" operator="=" enclosevalueinquotes="true"/>
<condition type="fieldvalue" field="Amount" operator="gte" inactive="true" enclosevalueinquotes="false" name="__autofilter__nstart__Amount" state="filterableoff" value=""/>
<condition type="fieldvalue" field="Amount" operator="lte" inactive="true" enclosevalueinquotes="false" name="__autofilter__nend__Amount" state="filterableoff" value=""/>
</conditions>
<actions/>
</model>
</models>
<components>
<pagetitle model="Opps" uniqueid="sk-3qFi-529">
<actions/>
<maintitle>Model on Opportunity, Model condition "Stage = Discovery", Filter on Amount</maintitle>
</pagetitle>
<skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="Opps" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-3qEJ-328">
<fields>
<field id="Account.Name" hideable="true" uniqueid="fi-3qG5-743"/>
<field id="Account.Phone" hideable="true" uniqueid="fi-3qG7-753"/>
<field id="Account.CreatedDate" hideable="true" uniqueid="fi-3qG8-762"/>
<field id="StageName" uniqueid="fi-3qEJ-332"/>
<field id="Amount" uniqueid="fi-3qEJ-333"/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
<filters>
<filter type="numericrange" createfilteroffoption="true" affectcookies="true" autocompthreshold="25" conditionsource="auto" labelmode="auto" filtermethod="server" conditionfield="Amount" filteroffoptionlabel="All amounts"/>
</filters>
</skootable>
</components>
<resources>
<labels/>
<javascript/>
<css/>
<actionsequences uniqueid="sk-3qE0-225"/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>
I also tried to use the model on Accounts. After you added “Opportunities” as Child Relationship field, you can apply conditions on it, e.g. “StageName = Discovery” and “Amount > 1000”.
So you will get a list of all Accounts, but you will only see filtered Opportunities. Is that the expected result? Please try the sample page below:
<skuidpage personalizationmode="server" showsidebar="false" useviewportmeta="true" showheader="false">
<models>
<model id="Accounts" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Account">
<fields>
<field id="RecordTypeId"></field>
<field id="Opportunities" type="childRelationship" limit="20">
<fields>
<field id="Amount"></field>
<field id="StageName"></field>
<field id="Name"></field>
</fields>
<conditions>
<condition enclosevalueinquotes="true" operator="=" type="fieldvalue" field="StageName" value="Discovery"></condition>
<condition enclosevalueinquotes="false" operator="gt" type="fieldvalue" field="Amount" value="1000"></condition>
</conditions>
</field>
<field id="Name"></field>
<field id="Phone"></field>
<field id="CreatedDate"></field>
</fields>
<conditions></conditions>
<actions></actions>
</model>
</models>
<components>
<skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="true" model="Accounts" buttonposition="" mode="read" allowcolumnreordering="true" responsive="true" uniqueid="sk-3qJW-344" heading='Model on Account, Child relationship condition "StageName = Discovery" and "Amount > 1000"'>
<fields>
<field id="Name" uniqueid="fi-3qJW-347"></field>
<field id="Phone" uniqueid="fi-3qJW-348"></field>
<field id="CreatedDate" uniqueid="fi-3qJW-349"></field>
<field id="Opportunities" type="CHILDREL" limit="100" uniqueid="fi-3qJW-346" allowhtml="true">
<label>Opportunities</label>
<template><b>Name: {{Name}}</b>
Stage: {{StageName}}
Amount: {{Amount}}
Thanks a lot Luzie. I was able create a field on Oppty and filter.
Great, thank you for the feedback!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.