child relationships conditions

  • 1
  • Problem
  • Updated 4 years ago
  • (Edited)
I am trying to set a condition on Child Relationships field in a model. When I set the condition using a specific value it works.  When I tried to use it using the option for values from source model it does not work. Source model and the relevant field does have the records and values and I have verified that by displaying the same in a field editor.  I am trying to use the source model based condition so that I can modify a condition on the source model itself to achieve a filter on child relationship records.  Is this a known issue?

Adding relevant sections from the XML file below.  SelectedMonth model does return rows and can be displayed in UI but somehow the condition on child relationship field does not seem to get the rows from the model and hence the query gets deactivated or aborted depending on the option set.  I have set the model action on SelectedMonth model to requery the target model so that child relationship records get filtered based on the condition (records in the source model).  But for some reason source model does not seem to return records to the child relationship condition.

 <model id="PS_DealList" limit="20" query="true" createrowifnonefound="false" sobject="PS_Deal_Line__c">         <fields>
            <field id="Deal_Name__c"/>
            <field id="PS_Deal_Line_Data__r" type="childRelationship" limit="10" orderby="Start_Month__r.Order__c">
               <conditions>
                  <condition operator="lte" type="modelmerge" value="" field="Start_Month__r.Order__c" model="SelectedMonth" enclosevalueinquotes="false" mergefield="Order__c" novaluebehavior="deactivate"/>
               </conditions>
               <fields>
                  <field id="Start_Month__r.Name"/>
                  <field id="Start_Month__r.Order__c"/>
               </fields>
            </field>
         </fields>
         <conditions/>
         <actions/>
      </model>
 
 
      <model id="SelectedMonth" limit="1" query="true" createrowifnonefound="true" sobject="Calendat_Month__c" orderby="Order__c DESC">
         <fields>
            <field id="Order__c"/>
            <field id="Name"/>
         </fields>
         <conditions>
            <condition type="fieldvalue" value="" enclosevalueinquotes="false" field="Order__c" state="filterableoff" inactive="true" operator="=" name="Order__c"/>
         </conditions>
         <actions>
            <action>
               <actions>
                  <action type="requeryModel" model="PS_DealList">
                     <onerroractions>
                        <action type="unblockUI" message="There was an error" timeout="3000"/>
                     </onerroractions>
                  </action>
               </actions>
               <events>
                  <event>models.loaded</event>
               </events>
            </action>
         </actions>
      </model>
Photo of Milind Gupte

Milind Gupte

  • 110 Points 100 badge 2x thumb

Posted 4 years ago

  • 1

Be the first to post a reply!