Created
March 30, 2013 14:54
-
-
Save zachelrath/5276990 to your computer and use it in GitHub Desktop.
Inline Snippet field renderer for the Quantity field on OpportunityLineItem object. Forces a concurrent update of the UnitPrice/SalesPrice field whenever Quantity is updated.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var field = arguments[0], | |
value = arguments[1]; | |
if (field.mode == 'read') { | |
skuid.ui.fieldRenderers.DOUBLE.read(field,value); | |
} else { | |
skuid.ui.fieldRenderers.DOUBLE.edit(field,value); | |
skuid.utils.delayInputCallback( | |
field.element.find('input'), | |
function(newValue) { | |
// Force updates of the UnitPrice (Sales Price) field | |
field.model.updateRow( | |
field.row, | |
'UnitPrice', | |
field.model.getFieldValue(field.row,'UnitPrice') | |
); | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment