Skip to main content
Nintex Community Menu Bar

dynamic listen for model close

  • July 8, 2024
  • 1 reply
  • 0 views
  • Translate

Forum|alt.badge.img+20

In a sharing mood today. 😃

Similar to this blog but slightly updated code.

http://www.mblazonry.com/creating-a-new-opportunity-in-salesforce-using-only-one-model-2/

// Listen for popup close of new record using just one model. // Snippet to be called after creating new row AND displaying popup // Only downside to this is that saving the model in the popup also saves any // other edits in the model. skuid.snippet.registerSnippet('listenForPopupClose',function(args) { var params = arguments[0], $ = skuid.$, row = params.context.row, model = params.context.model; skuid.$(".ui-dialog-content").dialog({ "beforeClose" : function() { var numOfChanges = Object.keys(model.changes).length; // if there is more than row that is currently changed (new, marked for deletion, edited) then this new row will be abandoned. if (numOfChanges &gt; 1){ model.abandonRow(row); // otherwise just mark if for deletion and save } else if (numOfChanges == 1) { model.deleteRow(row); model.save(); } } }); });<br>
Did this topic help you find an answer to your question?
This topic has been closed for comments

1 reply

annajosephine
Nintex Employee
Forum|alt.badge.img+18
  • Nintex Employee
  • 867 replies
  • July 8, 2024

How happy are the days when Pat’s in a sharing mood! Thanks for all this good stuff!

Translate

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings