Skip to main content
Nintex Community Menu Bar
Question

enable Button snippet on visible required fields having values

  • July 9, 2024
  • 1 reply
  • 8 views

Forum|alt.badge.img+20

Inspiration for this idea came from Moshe’s clone snippet. 😃

Snippet to evaluate required fields.

skuid.snippet.register('modelReqsMet',function(args) {var params = arguments[0], models = arguments[1], $ = skuid.$, regFields, enableButton = true; // loop through models $.each(models,function(m, model){ regFields = model.registeredFields; $.each(regFields,function(f,field){ if (field.required && !field.row[field.id]) { enableButton = false; } }); }); return enableButton; });


Sample snippet to check one model and set a UI only field of enableNext boolean to true. enableNext = true is used as an Enable Condition on a wizard button in my use case.

skuid.snippet.register('nuAgentReqs',function(args) {var params = arguments[0], $ = skuid.$, modelToUpdate = skuid.$M('nuAgency'), modelToUpdateRow = modelToUpdate.getFirstRow(), modelsToCheck = [skuid.$M('nuAgent')], snip = skuid.snippet.getSnippet('modelReqsMet'); if (snip(arguments[0], modelsToCheck)){ modelToUpdate.updateRow(modelToUpdateRow,{enableNext: true}); } });<br>

1 reply

Forum|alt.badge.img+17
  • Nintex Employee
  • July 9, 2024

Thanks for sharing these Pat.  They are very nice!