Long Problem Short: Is there any way to prevent rendering all the related fields on model.save()? Why??? I have a skuid page with pretty much all custom renders. I’m using the fact that registerSnippet gets called when a custom field is rendered to execute some business logic. For this example, I want to render a field only if another field has data. I also want the value of the rendered field to be a result from a callout. Example Code:
skuid.snippet.registerSnippet('RenderConditionalField', function(args) { var tModel = skuid.model.getModel('myModel'); var dependantField = tModel.getFirstRow().myField__c; if(dependantField){ MyController.getSomeValue(dependantField,function(){ //call function to render the field, pass in the value helpers.components.customPicklistRenderer(args, 'conditionalField__c', result); }); } });
This works great, except for a side effect of a poor design choice. These fields are all attached to my primary model. At the end of the business process, I save a couple fields to this model. Looks like this calls the render function on all the fields related to the model, which in turn executes my custom render snippets. The conditional statements in my snippets at the point have all been met, causing some undesired effect (some webservice callouts execute). I’m kinda hoping there is something in the undocumented model.save: options object that might be what I’m looking for. If not, I can probably just move all my custom fields to a dummy Model that has no interaction with the BL. Just wanted to check before begin refactoring.