Skip to main content

What is the Syntax for Re-querying a model inside JavaScript Snippet??  I want to requery a model inside the Snippet…Can anyone help me on this issue…

https://developer.skuid.com/latest/en/api/skuid_model_model.html#skuid.model.Model.updateData


Hi Matt, thank you for such a prompt response, can you please help me out with that particular snippet? I am calling a webservice Apex class which creates a new Record, I need to requery that model so that I can pick that newly created Record Id and redirect the user to that record automatically…


Assuming you have a model called MyModel and a condition on that model called ‘IdConditionName’ (which is a filterable default on condition where Id=‘’), you can do something like this:


var $ = skuid&#46;$,<br />&nbsp; &nbsp; &nbsp;model = skuid&#46;$M('MyModel');<br />&#47;&#47;var newRowId = whatever your class returns as the Id of the new row<br />model&#46;setCondition(model&#46;getConditionByName('IdConditionName'),newRowId);<br />$&#46;when(model&#46;updateData())&#46;then(function(){<br />&nbsp; &nbsp;&#47;&#47;Do anything you need to do after the query here&#46;<br />});

Wow, Well Thank you so so much Matt, It worked beautifully. Thank you so much for the snippet. I really appreciate you coming up and helping me out.

Thanks Again!