How do I refresh (updateData) a model with a dependent modelmerge condition?

Hi Zac, Sorry for the short reply earlier, I’m on leave so couldn’t give more details. I know it’s important to give you something to work off so I’ve quickly tried to isolate the issue a little more (the actual scenario is a visualforce/skuid hybrid so harder to give you something you can work with). I’ve given you a simple page with the two models, entitysubscription and followers. The page is trying to show the list of followers for a record so you need to supply the id of a record in the url, e.g. https://skuid.cs6.visual.force.com/apex/skuid__ui?page=ChatterFollowersSkuid&id=001N0000007BuF8. I picked a random account with no followers and followed it. Then I load this skuid page and inspect the underlying skuid models using the browser console: 1. Since the record has one follower the results are correct after page load:

followersModel.soql "SELECT Id,PostalCode,Username,FullPhotoUrl,Street,Phone,LanguageLocaleKey,Extension,Email,Division,Department,CompanyName,City,AboutMe,TimeZoneSidKey,MobilePhone,Title,State,Country,LastName,FirstName,SmallPhotoUrl,Name FROM User WHERE ((Id in ('00590000001WKBKAA4'))AND(IsActive = true)) ORDER BY Name LIMIT 1000" followersModel.data.length 1 entitySubscriptionFollowersModel.soql "SELECT Id,Parent.Name,ParentId,Subscriber.Name,SubscriberId FROM EntitySubscription WHERE ((ParentId = '001N0000007BuF8')) LIMIT 1000" entitySubscriptionFollowersModel.data.length 1 
  1. Then we open a new tab, go to the record page and stop following the record so that it no longer has any followers. 3. Then we go back to the skuid page and run the multiple update data call as discussed (to try and pick up the changes):
skuid.model.updateData([entitySubscriptionFollowersModel,followersModel],function(){console.log('complete')}) complete <pre>
  1. The followers model does not seem to refresh it’s query and still returns one follower:

followersModel.soql “SELECT Id,PostalCode,Username,FullPhotoUrl,Street,Phone,LanguageLocaleKey,Extension,Email,Division,Department,CompanyName,City,AboutMe,TimeZoneSidKey,MobilePhone,Title,State,Country,LastName,FirstName,SmallPhotoUrl,Name FROM User WHERE ((Id in (‘00590000001WKBKAA4’))AND(IsActive = true)) ORDER BY Name LIMIT 1000” followersModel.data.length 1 4. But the dependant entitysubscription model runs correctly and shows there are no followers so why does the follower model above not pick this up?

entitySubscriptionFollowersModel.soql "SELECT Id,Parent.Name,ParentId,Subscriber.Name,SubscriberId FROM EntitySubscription WHERE ((ParentId = '001N0000007BuF8')) LIMIT 1000" entitySubscriptionFollowersModel.data.length 0 

Hope that makes things clearer and you can reproduce it or tell me what I’m doing wrong. Thanks for looking at this. Cheers, Stephen

<skuidpage showsidebar="false" showheader="false"> <resources> <labels/> <javascript> <jsitem location="inline" name="PageLoad">var cefiType = 'News'; var entitySubscriptionFollowersModel = null; var followersModel = null; jQuery(document).ready(function() { entitySubscriptionFollowersModel = skuid.model.getModel('EntitySubscriptionFollowers'); followersModel = skuid.model.getModel('Followers'); }); </jsitem> </javascript> <css/> </resources> <models> <model id="EntitySubscriptionFollowers" limit="999" query="true" createrowifnonefound="false" sobject="EntitySubscription"> <fields> <field id="SubscriberId"/> <field id="Subscriber.Name"/> <field id="ParentId"/> <field id="Parent.Name"/> </fields> <conditions> <condition type="param" value="id" field="ParentId" operator="=" userinfotype="userid" enclosevalueinquotes="true"/> </conditions> </model> <model id="Followers" limit="999" query="true" createrowifnonefound="false" sobject="User" orderby="Name"> <fields> <field id="Name"/> <field id="Id"/> <field id="SmallPhotoUrl"/> <field id="FirstName"/> <field id="LastName"/> <field id="Country"/> <field id="State"/> <field id="Title"/> <field id="MobilePhone"/> <field id="TimeZoneSidKey"/> <field id="AboutMe"/> <field id="City"/> <field id="CompanyName"/> <field id="Department"/> <field id="Division"/> <field id="Email"/> <field id="Extension"/> <field id="LanguageLocaleKey"/> <field id="Phone"/> <field id="Street"/> <field id="FullPhotoUrl"/> <field id="Username"/> <field id="PostalCode"/> </fields> <conditions> <condition type="modelmerge" value="" field="Id" operator="in" model="EntitySubscriptionFollowers" enclosevalueinquotes="true" mergefield="SubscriberId" state="filterableon" inactive="false" name="Followers"/> <condition type="fieldvalue" value="true" enclosevalueinquotes="false" field="IsActive"/> </conditions> </model> </models> <components> <skootable showconditions="true" showsavecancel="false" searchmethod="client" searchbox="true" showexportbuttons="false" pagesize="5" createrecords="false" model="Followers" mode="readonly" uniqueid="FollowersTable"> <fields> <field id="SmallPhotoUrl" columnwidth="" type="CUSTOM" snippet="RenderChatterPhoto" readonly="true"> <label>Followers</label> </field> <field id="Name" type="" snippet="RenderChatterLike" columnwidth="90%" readonly="true"> <label>&amp;nbsp;</label> </field> </fields> <rowactions> <action type="popup" window="self" icon="ui-silk-folder-explore" label="Details"> <popup title="Details for {{Name}}" width="900"> <components> <pagetitle model="Followers"> <actions> <action type="custom" label="Close" icon="ui-silk-cross" snippet="ClosePopup"/> </actions> <conditions> <condition type="contextrow" field="Id" autocreated="true"/> </conditions> </pagetitle> <panelset type="standard"> <panels> <panel width="300" type="left"> <components> <basicfieldeditor showheader="true" showsavecancel="false" model="Followers" mode="readonly" layout="above"> <columns> <column width="100%"> <sections> <section title="Name"> <fields> <field id="Name" type="CUSTOM" snippet="RenderText"/> <field id="FullPhotoUrl" type="CUSTOM" snippet="RenderPhotoLarge" readonly="false"> <label/> </field> </fields> </section> </sections> </column> </columns> <conditions> <condition type="contextrow" field="Id" autocreated="true"/> </conditions> </basicfieldeditor> </components> </panel> <panel> <components> <basicfieldeditor showheader="true" showsavecancel="false" model="Followers" mode="readonly"> <columns> <column width="50%"> <sections> <section title="Details"> <fields> <field id="Title"/> <field id="Department"/> <field id="TimeZoneSidKey"/> <field id="AboutMe"/> </fields> </section> </sections> </column> <column width="50%"> <sections> <section title="Contact"> <fields> <field id="MobilePhone"/> <field id="Phone"/> <field id="Extension"/> <field id="Email" type="CUSTOM" snippet="RenderText"/> </fields> </section> <section title="Address"> <fields> <field id="Street"/> <field id="City"/> <field id="PostalCode"/> <field id="State"/> <field id="Country"/> </fields> </section> </sections> </column> </columns> <conditions> <condition type="contextrow" field="Id" autocreated="true"/> </conditions> </basicfieldeditor> </components> </panel> </panels> </panelset> </components> </popup> </action> </rowactions> <views> <view type="standard"/> </views> <filters/> </skootable> </components> </skuidpage>