Tab action to activate a model condition does not work

  • 1
  • Problem
  • Updated 2 months ago
  • In Progress
I have a page with two tabs and table under each tab. Both the tables use same model with some filterable off conditions. I am trying to activate these conditions on selection of these tab using tab actions but for some reason it is not working. When I select a tab it takes few seconds but does not return any records.

Thanks,
Shalabh
Photo of Shalabh Sharma

Shalabh Sharma

  • 294 Points 250 badge 2x thumb

Posted 9 months ago

  • 1
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Can you post the XML of what you have so we can take a look at it? If you can in detail explain what you're doing and why you're doing it that way, we might be able to help.
Photo of Shalabh Sharma

Shalabh Sharma

  • 294 Points 250 badge 2x thumb
So, I have two tabs with two tables. Both the tables run on the same model but shows different set of records based on a condition. I am trying to activate that condition on click of the tab otherwise I have to create two models to show different data in the two tables. 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Shalabh - are you sure that you are both setting the conditions and requerying the models?   Just setting the conditions will not actually update the data. 
Photo of Shalabh Sharma

Shalabh Sharma

  • 294 Points 250 badge 2x thumb
Yep, I am activating the condition first and then querying the model.
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Shalabh,

What version of Skuid are you using?  I just tried this in 11.1.1.  It definitely works.

One other way you can do this is to remove the 2nd table component and then pull the remaining table below the tab component.  This will make the single table component visible no matter what tab you select.  You would then be using the tab component as a simple control to set the conditions on a single table.

Thanks,

Bill
Photo of Sam Becker

Sam Becker

  • 1,178 Points 1k badge 2x thumb
Hello, I believe I'm having the same issue. I have an action set to fire on the Model "ActivitiesOpen" when the condition labeled "Subject" is activated. It's supposed to activate a condition on he "ActivitiesCompleted" model and then re-query the model. However, its not working. 

I even checked Chrome Console with skuid.model.getModel('ActivitesCompleted') and it shows the model as inactive, but the condition on the ActivitiesOpen goes from inactive to active. 

I'm on 11.2.6 on Salesforce. Here's my XML for those models.

 <model id="ActivitiesOpen" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Task" orderby="CreatedDate DESC">
            <fields>
                <field id="Id"/>
                <field id="OwnerId"/>
                <field id="Owner.Name"/>
                <field id="IsClosed"/>
                <field id="CreatedDate"/>
                <field id="CreatedById"/>
                <field id="CreatedBy.Name"/>
                <field id="Description"/>
                <field id="IsHighPriority"/>
                <field id="WhoId"/>
                <field id="Who.Name"/>
                <field id="Priority"/>
                <field id="WhatId"/>
                <field id="What.Name"/>
                <field id="Type"/>
                <field id="Subject"/>
                <field id="Status"/>
                <field id="ActivityDate"/>
            </fields>
            <conditions logic="(1 OR 3) AND 2 AND 4">
                <condition type="param" value="id" field="AccountId" fieldtargetobjects="Account" operator="=" enclosevalueinquotes="true"/>
                <condition type="fieldvalue" value="Open" enclosevalueinquotes="true" field="Status"/>
                <condition type="param" value="id" field="WhatId" fieldtargetobjects="AS_Tax__Account_Tax__c,Account,AcctSeed__AP_Credit_Memo__c,AcctSeed__AP_Disbursement__c,AcctSeed__Account_Payable_Line__c,AcctSeed__Account_Payable__c,AcctSeed__Accounting_Period__c,AcctSeed__Accounting_Variable__c,AcctSeed__Bank_Deposit__c,AcctSeed__Bank_Reconciliation2__c,AcctSeed__Billing_Cash_Receipt__c,AcctSeed__Billing_Credit_Memo__c,AcctSeed__Billing_Format__c,AcctSeed__Billing_Line__c,AcctSeed__Billing_Rates__c,AcctSeed__Billing__c,AcctSeed__Cash_Disbursement_Batch__c,AcctSeed__Cash_Disbursement__c,AcctSeed__Cash_Receipt__c,AcctSeed__Cost_Rates__c,AcctSeed__Expense_Line__c,AcctSeed__Expense_Report__c,AcctSeed__Financial_Cube__c,AcctSeed__Fixed_Asset__c,AcctSeed__GL_Account__c,AcctSeed__Journal_Entry_Line__c,AcctSeed__Journal_Entry__c,AcctSeed__Ledger__c,AcctSeed__Product_Part__c,AcctSeed__Project_Task__c,AcctSeed__Project__c,AcctSeed__Recurring_Account_Payable_Line__c,AcctSeed__Recurring_Account_Payable__c,AcctSeed__Recurring_Billing_Line__c,AcctSeed__Recurring_Billing__c,AcctSeed__Scheduled_Revenue_Expense__c,AcctSeed__Time_Card_Accounting_Period__c,AcctSeed__Time_Card_Day__c,AcctSeed__Time_Card_Line__c,AcctSeed__Time_Card_Period__c,AcctSeed__Time_Card__c,Administration__c,Asset,AssetRelationship,BOM_Line_Item__c,Bug__c,Campaign,Case,Contract,Customer_Part_Number__c,Department_Labor_Rate__c,Department__c,Employees__c,HOS_Release__c,InventoryCycle__c,Issues_Ideas__c,Job_Allocations__c,Job_Operations__c,Location_Tracker__c,Multi_Serial_Deductions__c,Multi_Serial_Numbers__c,OP_Line_Item__c,Operation__c,Operations_Line_Item__c,Opportunity,Order,Part__c,Product2,Project_Case__c,Property__c,Purchase_Order__c,Quote,Receiving__c,Restaurant__c,Return_Line__c,Return__c,Sales_Order_Line_Item__c,Sales_Order__c,Scheduling__c,Shipping_Line_Item__c,Shipping__c,Sing_Serial_Deductions__c,Single_Serial_Numbers__c,Solution,Time_Tracker__c,WorkOrder,WorkOrderLineItem,Workcenter_Location__c,rh2__PS_Export_Rollups__c,rh2__PS_Rollup_Dummy__c" operator="=" enclosevalueinquotes="true"/>
                <condition type="fieldvalue" value="Internal Issue" enclosevalueinquotes="true" field="Subject" state="filterableoff" inactive="true" name="Subject"/>
            </conditions>
            <actions>
                <action>
                    <actions>
                        <action type="activateCondition" model="ActivitiesCompleted" condition="Subject1"/>
                        <action type="requeryModel" model="ActivitiesCompleted" behavior="standard"/>
                    </actions>
                    <events>
                        <event>condition.activated</event>
                    </events>
                    <conditions>
                        <condition>Subject</condition>
                    </conditions>
                </action>
            </actions>
        </model>
        <model id="ActivitiesCompleted" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Task" orderby="CreatedDate DESC">
            <fields>
                <field id="Id"/>
                <field id="OwnerId"/>
                <field id="Owner.Name"/>
                <field id="IsClosed"/>
                <field id="CreatedDate"/>
                <field id="CreatedById"/>
                <field id="CreatedBy.Name"/>
                <field id="Description"/>
                <field id="IsHighPriority"/>
                <field id="WhoId"/>
                <field id="Who.Name"/>
                <field id="Priority"/>
                <field id="WhatId"/>
                <field id="What.Name"/>
                <field id="Type"/>
                <field id="Subject"/>
                <field id="Status"/>
                <field id="ActivityDate"/>
            </fields>
            <conditions logic="(1 OR 2) AND 3 AND 4">
                <condition type="param" value="id" field="AccountId" fieldtargetobjects="Account" operator="=" enclosevalueinquotes="true"/>
                <condition type="param" value="id" field="WhatId" fieldtargetobjects="AS_Tax__Account_Tax__c,Account,AcctSeed__AP_Credit_Memo__c,AcctSeed__AP_Disbursement__c,AcctSeed__Account_Payable_Line__c,AcctSeed__Account_Payable__c,AcctSeed__Accounting_Period__c,AcctSeed__Accounting_Variable__c,AcctSeed__Bank_Deposit__c,AcctSeed__Bank_Reconciliation2__c,AcctSeed__Billing_Cash_Receipt__c,AcctSeed__Billing_Credit_Memo__c,AcctSeed__Billing_Format__c,AcctSeed__Billing_Line__c,AcctSeed__Billing_Rates__c,AcctSeed__Billing__c,AcctSeed__Cash_Disbursement_Batch__c,AcctSeed__Cash_Disbursement__c,AcctSeed__Cash_Receipt__c,AcctSeed__Cost_Rates__c,AcctSeed__Expense_Line__c,AcctSeed__Expense_Report__c,AcctSeed__Financial_Cube__c,AcctSeed__Fixed_Asset__c,AcctSeed__GL_Account__c,AcctSeed__Journal_Entry_Line__c,AcctSeed__Journal_Entry__c,AcctSeed__Ledger__c,AcctSeed__Product_Part__c,AcctSeed__Project_Task__c,AcctSeed__Project__c,AcctSeed__Recurring_Account_Payable_Line__c,AcctSeed__Recurring_Account_Payable__c,AcctSeed__Recurring_Billing_Line__c,AcctSeed__Recurring_Billing__c,AcctSeed__Scheduled_Revenue_Expense__c,AcctSeed__Time_Card_Accounting_Period__c,AcctSeed__Time_Card_Day__c,AcctSeed__Time_Card_Line__c,AcctSeed__Time_Card_Period__c,AcctSeed__Time_Card__c,Administration__c,Asset,AssetRelationship,BOM_Line_Item__c,Bug__c,Campaign,Case,Contract,Customer_Part_Number__c,Department_Labor_Rate__c,Department__c,Employees__c,HOS_Release__c,InventoryCycle__c,Issues_Ideas__c,Job_Allocations__c,Job_Operations__c,Location_Tracker__c,Multi_Serial_Deductions__c,Multi_Serial_Numbers__c,OP_Line_Item__c,Operation__c,Operations_Line_Item__c,Opportunity,Order,Part__c,Product2,Project_Case__c,Property__c,Purchase_Order__c,Quote,Receiving__c,Restaurant__c,Return_Line__c,Return__c,Sales_Order_Line_Item__c,Sales_Order__c,Scheduling__c,Shipping_Line_Item__c,Shipping__c,Sing_Serial_Deductions__c,Single_Serial_Numbers__c,Solution,Time_Tracker__c,WorkOrder,WorkOrderLineItem,Workcenter_Location__c,rh2__PS_Export_Rollups__c,rh2__PS_Rollup_Dummy__c" operator="=" enclosevalueinquotes="true"/>
                <condition type="fieldvalue" value="Completed" enclosevalueinquotes="true" field="Status"/>
                <condition type="fieldvalue" value="Internal Issue" enclosevalueinquotes="true" field="Subject" state="filterableoff" inactive="true" name="Subject1"/>
            </conditions>
            <actions/>
        </model>
Photo of Sam Becker

Sam Becker

  • 1,178 Points 1k badge 2x thumb
Actually, I just found how to fix it, but I still think it's a bug. 

I have a filter on a Filter Set with the following options
Filter Type: Select Option
Filter Method: Server
Pick Options and Conditions(s): Manually
Model Condition to Affect: Subject

The Source Type of the filter is Manual and I have 2 options. 

In order to fix the problem, I changed the properties on the manual options I created from "What Conditions will this Option affect?" from "Affect Default Condition" to "Affect Other Condition(s)" and then added an Action to Activate the Condition.

It's doing the same thing as if I had selected "Affect Default Condition" but for some reason that doesn't fire the Action event on the model.