Better Management of Opportunity Line Items with SKUID

Peter, I think that the issue does actually have to do with the Currency, i’ve seen this in other orgs before. Here’s how to fix, I think: 1. Make sure that the “CurrencyIsoCode” field is added to your PricebookEntries model, and that the PricebookEntry.CurrencyIsoCode field is added to your OpportunityLineItems model. 2. Change the snippet code to this:

var field = arguments[0], value = arguments[1], renderer = skuid.ui.fieldRenderers[field.metadata.displaytype], mode = field.mode; if (mode == 'edit') { // Specify that we want to display our field as a Picklist field.options.type = 'REFPICK'; } // Run standard renderer for the current mode // (applies to read/edit mode) renderer[mode](field,value); // Function that will update the value of our LineItem row's UnitPrice field // based on the selected PricebookEntry's ListPrice / UnitPrice var updateUnitPriceField = function(){ var newPrice = field.model.getFieldValue(field.row,'PricebookEntry.UnitPrice'); var newCurrency = field.model.getFieldValue(field.row,'PricebookEntry.CurrencyIsoCode'); // Force updates of the UnitPrice (SalesPrice) field //with the newly-selected PricebookEntry's UnitPrice field field.model.updateRow(field.row,'UnitPrice',newPrice); if (newCurrency) { field.model.updateRow(field.row,'CurrencyIsoCode',newCurrency); } // Rerender the UnitPrice field in the row, // if that field has been rendered. var item = field.editor.lists[0].renderedItems[field.row.Id]; if (item) { $j.each(item.fields,function(i,f){ if (f.id == 'UnitPrice') { f.render(); return false; } }); } }; if (mode == 'edit') { // If we do not yet have a value for our UnitPrice field, // update it. if (!field.model.getFieldValue(field.row,'UnitPrice')) { updateUnitPriceField(); } // Attach an event handler to our field's <select> picklist element var select = field.element.find('select'); select.on('change',function(){ updateUnitPriceField(); }); }