+ Start a Discussion
Cloud AtlasCloud Atlas 

Storing AngularJS value from Visualforce page into an Object

I have a requirement to store an AngularJS "SUM"  value being calculated directly on the VF page in an object.
I already have that value, just not sure how to being it in Salesforce..
 
​<span ng-bind="table.totalAmount"></span>
Does any one have any experience with such type of issue.

Thanks!

 
Vivek DVivek D
Can you explain this in little more details. 
I am assuming you want to move table total value to Salesforce.
  1. If you want to move automatically then use $watch and call a factory which will have a remoting method to insert the value to SF object. But this is not prefered because everytime there will be a change it will call the remoting method.
  2. You can do the same on click of a button that way you will have the control
Cloud AtlasCloud Atlas
Hi Vivek....

My bad. I should have explained better.

So what is happening is that I have a VF page with AngularJS script.
The page displays records from an object ( lets call it Object__c) and each reord has an Amount (Amount__c) associated to it.
A button ("Submit For Approval") has been provided to submit the records displayed on VF page for Approval.
When this button gets clicked, the amount in each records gets summed up by the AngularJS script.
I can already see where this value is on VF page..
<span ng-bind="table.totalAmount"></span>
What I am looking for is a way to save this value  (table.TotalAmount) as a currency field (Total_Amount__c) in the Object__c.
And I don't know how I should do it.

Let me know if it makes sense.

Thanks!