Assign Custom Field Render Value to Actual Field Value

  • 1
  • Question
  • Updated 4 years ago
  • Answered
Is there any way that I can assign values from a custom field rendering snippet so that it is pushed into the actual Field Value? I have a custom snippet that calculates a Running Balance, but the actual value of the "Balance" field in SalesForce is still blank.

Can anyone suggest a solution or workaround? Would be greatly appreciated.
Photo of mB Roman Melnik

mB Roman Melnik

  • 2,802 Points 2k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,646 Points 5k badge 2x thumb
var field = arguments[0],    value = arguments[1],
    $ = skuid.$;
var row = field.row;
var model = field.model;
//do your calculation here...
//assuming value is now the new value... 
model.updateRow(row,'Your_Field__c',value,{
initiatorId: field._GUID
});
skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field,value);
Photo of mB Roman Melnik

mB Roman Melnik

  • 2,802 Points 2k badge 2x thumb
Thank you for the quick reply Moshe. The code above worked great for me.

I was partly there with "model.updateRow", but seemed to be missing the "initiatorId: field._GUID"

Big thank you!