I am trying to update a formula field Available_Quantity__c in table row when WarehouseReference__r(a field in order object) is updated. Available_Quantity__c is a formula field in Order object which is referencing a field from Repository_Product (Available_Qty__c). I wrote below code referring code snippet from this community. But unfortunately its not working for me. Please let me know whats the issue, or is there any other way i can do this without using code snippet by using conditions on models and actions. (function(skuid){ var $ = skuid.$; var makeFieldsEditable = function() { var field = skuid.$M(‘Order’).getField(‘Available_Quantity__c’); $.extend(field, { createable: true, editable: true }); }; skuid.snippet.registerSnippet(‘handleAccountChange’, function(field, value) { // pass true for third parameter so that the value returned is not escaped var acctCity = field.model.getFieldValue(field.row, ‘RepositoryProduct__r.Available_Qty__c’, true) , formulaValue = acctCity; field.model.updateRow(field.row, ‘Available_Quantity__c’, formulaValue); }); $(function(){ // make sure our fields are marked creatable/editable makeFieldsEditable(); }); })(skuid);
Question
Trying to update a formula field of table row when a reference field is updated
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
