Created
October 31, 2014 13:21
-
-
Save pchittum/83013b211f66b85723ba to your computer and use it in GitHub Desktop.
VF Remoting - Curious Behavior of NumberOfEmployees field in Account
This file contains hidden or 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
| public class RemoteApexTestNumOfEmployees { | |
| @RemoteAction | |
| public static void putAccount(Account a){ | |
| update a; | |
| } | |
| } |
This file contains hidden or 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
| <apex:page docType="html-5.0" controller="RemoteApexTestNumOfEmployees" > | |
| <script> | |
| function putAccount(){ | |
| var account = { | |
| Id : document.getElementById("accountPutId").value, | |
| NumberOfEmployees : document.getElementById("accountPutNumEmp").value, | |
| AnnualRevenue : document.getElementById("annRev").value | |
| }; | |
| console.log(account); | |
| RemoteApexTestNumOfEmployees.putAccount(account, function(result, event){ | |
| console.log(event); | |
| }); | |
| } | |
| </script> | |
| <div> | |
| <input id="accountPutId" type="text" placeholder="Id"/> | |
| <input id="accountPutNumEmp" type="number" placeholder="Num Of Employees"/> | |
| <input id="annRev" type="number" placeholder="Revenue"/> | |
| <button onClick="putAccount()"> | |
| Go | |
| </button> | |
| </div> | |
| </apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment