Filter the values from a picklist given in Table 1 and display the records according to picklist value in Table 2.

  • 1
  • Question
  • Updated 2 years ago
Hi All, I am very new to Salesforce and SKUID also. Just started using SKUID 2 days before.
I am facing an issue of displaying the values in Table 2 as per the value selected in Table 1 picklist.

Please look into this matter.
Photo of khushboo$007

khushboo$007

  • 100 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Matthias

Matthias

  • 628 Points 500 badge 2x thumb
All kinds of filters in skuid are tied to the model they are based on. Meaning if you have two different tables which are based on the same model, the picklist works for both of the table (as the picklist filters the model entrys not just the table).
If the two tables are based on different models, they only work for the model they are assigned to.

one easy solution for you could be to filter the contents of the second model based on the first.

To do so do the following steps:
1. Go to the Model used for table 2 add a condition and set its field to the field you want to match in regard to the first model and for the value choose field from another Model and select the field your picklist is based on. Set the condition on always on
(additional help: http://help.skuid.com/m/models-conditions-filters/l/102653-what-are-conditions )

2. Go to the Model used for table 1 go to actions and add an action. Choose to fire on model requeried. add an Action which querys model 2.
(additional help: http://help.skuid.com/m/models-conditions-filters/l/476206-model-actions?id=476206-model-actions )

3. try it out.

Please let me know if this fixes the issue or if you run into additional problems
Photo of khushboo$007

khushboo$007

  • 100 Points 100 badge 2x thumb
Dear Matthias,


Thanks for your reply...
Below attached XML code of the page I created.
What I required is whenever I select the account name from the lookup, it will display all related cases below the accounts (on the same page).



<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Account">
    <models>
        <model id="Account" limit="20" query="true" createrowifnonefound="false" adapter="salesforce" type="" sobject="Account">
            <fields>
                <field id="Description"/>
                <field id="Fax"/>
                <field id="Id"/>
                <field id="Name"/>
                <field id="Phone"/>
                <field id="Type"/>
                <field id="AccountSource"/>
                <field id="AnnualRevenue"/>
            </fields>
            <conditions>
                <condition type="param" value="Id" field="Id" operator="=" enclosevalueinquotes="true" novaluebehavior=""/>
            </conditions>
            <actions>
                <action>
                    <actions>
                        <action type="requeryModel" model="Cases" behavior="standard"/>
                    </actions>
                    <events>
                        <event>models.loaded</event>
                    </events>
                </action>
            </actions>
        </model>
        <model id="Cases" limit="20" query="true" createrowifnonefound="false" adapter="salesforce" type="" sobject="Case">
            <fields>
                <field id="CaseNumber"/>
                <field id="CreatedDate"/>
                <field id="Status"/>
                <field id="Subject"/>
            </fields>
            <conditions>
                <condition type="modelmerge" value="" field="Account.Id" operator="=" model="Account" enclosevalueinquotes="true" mergefield="Id" novaluebehavior="deactivate" state=""/>
                <condition type="modelmerge" value="" field="Account.Name" operator="=" model="Account" enclosevalueinquotes="true" mergefield="Name" novaluebehavior="deactivate"/>
            </conditions>
            <actions/>
        </model>
    </models>
    <components>
        <pagetitle model="Account" uniqueid="sk-1wYsf5-174">
            <maintitle>
                <template>{{Name}}</template>
            </maintitle>
            <subtitle>
                <template>{{Model.label}}</template>
            </subtitle>
            <actions/>
        </pagetitle>
        <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="Account" buttonposition="" uniqueid="sk-1wYeDY-117" mode="read" layout="">
            <columns layoutmode="fixed">
                <column width="50%">
                    <sections>
                        <section title="Section A" collapsible="no">
                            <fields>
                                <field id="Description" valuehalign="" type=""/>
                                <field id="Phone" valuehalign="" type=""/>
                                <field id="Name" valuehalign="" type="" readonly="false">
                                    <renderconditions logictype="and" onhidedatabehavior="keep"/>
                                    <enableconditions logictype="and"/>
                                </field>
                                <field id="Type"/>
                            </fields>
                        </section>
                    </sections>
                </column>
                <column width="50%">
                    <sections>
                        <section title="Section B">
                            <fields>
                                <field id="Fax" valuehalign="" type=""/>
                                <field id="Id" valuehalign="" type=""/>
                                <field id="AnnualRevenue" decimalplaces="" valuehalign="" type=""/>
                                <field id="AccountSource" valuehalign="" type=""/>
                            </fields>
                        </section>
                    </sections>
                </column>
            </columns>
        </basicfieldeditor>
        <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Cases" buttonposition="" mode="read" uniqueid="sk-1waP3f-248" emptysearchbehavior="query">
            <fields>
                <field id="CaseNumber"/>
                <field id="CreatedDate"/>
                <field id="Status"/>
                <field id="Subject"/>
            </fields>
            <rowactions>
                <action type="edit"/>
                <action type="delete"/>
            </rowactions>
            <massactions usefirstitemasdefault="true">
                <action type="massupdate"/>
                <action type="massdelete"/>
                <action type="popup" label="Run multiple actions" icon="sk-icon-magic">
                    <popup title="New Popupngbjntghfdfghdfghd&lt;b&gt;test&lt;/b&gt; " width="90%">
                        <components/>
                    </popup>
                </action>
            </massactions>
            <views>
                <view type="standard"/>
            </views>
            <searchfields/>
            <renderconditions logictype="custom" logic="2"/>
        </skootable>
    </components>
    <resources>
        <labels/>
        <javascript/>
        <css/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>
Photo of Matthias

Matthias

  • 628 Points 500 badge 2x thumb
Sorry but tbh i'm not sure what exactly you want in regard of an account picklist(as in a default org, the picklist you have displayed in the page have static content). Also i'm a bit confused in regards of two tables as there is only one table and a field editor in the page.

Based on this example my tipp from erlier on won't help you solve this problem.

If you could tell me which picklist you are using (and if maybe there are some changes to the picklists backend) to filter and which casefield you want to base the filter on, i could help you.