Skip to content

Instantly share code, notes, and snippets.

@cam8001
Created September 8, 2014 19:50
Show Gist options
  • Select an option

  • Save cam8001/1d8006baeed122b96711 to your computer and use it in GitHub Desktop.

Select an option

Save cam8001/1d8006baeed122b96711 to your computer and use it in GitHub Desktop.
Sum a bundle in SFDC
sum = 0;
// Get Bundle 2.
var bundle = jQuery('.editPage .pbBody').children('div')[1];
jQuery('td[id*=j_id292]', bundle).each(function(index, value){
line_item_cost = value.innerHTML;
line_item_cost = +line_item_cost.replace(/[^\d\.-]/g,'');
sum = sum + parseFloat(line_item_cost);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment