I have a snippet that creates new rows through a mass action. Since upgrading to 11.1.1, the snippet creates the first record twice and I cannot seem to find a way around it. This was happening with two models on the snippet so I commented out one and added it separately as it’s own action but we need to have rows that are created from selected table items. Is this a bug or am I doing something incorrectly?
Snippet below:
var params = argumentst0],<br> $ = skuid.$;<br><br>var table = skuid.$C('sk-3-w0AD-637');<br>var list = table.element.data('object').list; <br>var selectedItems = list.getSelectedItems();<br>var newQuote = skuid.$M('NewQuote');<br>var quoteLines = skuid.$M('NewQuoteLineItems');<br><br>console.log(selectedItems);<br><br>//create a new quote<br>//newQuote.createRow();<br><br><br><br>$.each(selectedItems, function(){<br> var row = this.row;<br> createNewRows(row.Id, row.Product2Id, row.Quantity, row.UnitPrice, row.ServiceDate, row.PricebookEntryId);<br>});<br><br><br><br>function createNewRows(id, product, quantity, salesprice, startdate, pricebookentry){<br> quoteLines.createRow({<br> additionalConditions:s<br> {field:'QuoteId', value: newQuote.datat0].Id},<br> {field:'Product2Id', value: product},<br> {field:'Quantity', value: quantity},<br> {field:'UnitPrice', value: salesprice},<br> {field:'ServiceDate', value: startdate},<br> {field:'PricebookEntryId', value: pricebookentry},<br> {field:'OpportunityLineItemId', value: id}<br> <br> ], editModeForNewItems: true,<br> doAppend: true<br>});<br>}<br><br>console.log(quoteLines);<br><br><br><br>var wizard = $('.nx-wizard').data('object'); <br>var currentStep = wizard.stepspwizard.currentstep];<br>currentStep.navigate('quoteEdit');