Skip to content

Instantly share code, notes, and snippets.

@pchittum
Created October 31, 2014 13:21
Show Gist options
  • Select an option

  • Save pchittum/83013b211f66b85723ba to your computer and use it in GitHub Desktop.

Select an option

Save pchittum/83013b211f66b85723ba to your computer and use it in GitHub Desktop.
VF Remoting - Curious Behavior of NumberOfEmployees field in Account
public class RemoteApexTestNumOfEmployees {
@RemoteAction
public static void putAccount(Account a){
update a;
}
}
<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