Skip to main content

I have a field editor where I review the detail of record stored in a model.  When I save the model, I need to update the “Status__c” field by checking all of the fields in the model.  I’m using a Snippet, but I’m not sure how to do this.  The snippet needs to review only the current record and eventually output a status based on the data.  It will need to review only the fields that I will require, so I’ll need to be able to identify specific fields.  I will also need to tell if certain fields are null or not.  Can anyone start me in the right direction?

Going the snippet route is correct here. 

Use our model API to call the fields from the record. 
Use basic If - Then logic in javascript to choose an appropraite status value. 
Use our field renderer to put the value into the status field.  

Code somthing like this: 


skuid.ui.fieldRenderers.TEXT.field.mode](field, value); 

Look at this forum post for more fleshed out ideas:  https://community.skuid.com/t/custom-field-renderer-simple-math?topic-reply-listlsetti…
 


is there a way to render the model field, rather than having to render the field in any place it appears?  The Status is displayed in multiple spots.


I’m not exactly sure what you are asking.  But I think the custom renderer on the one field will actually save the calculated value to the database.  Then wherever that field is displayed on the page it will be updated. 


Reply