global class myClass | |
{ | |
global class wrapperClass | |
{ | |
public String name {get; set;} | |
public Account account {get; set;} | |
public wrapperClass() | |
{ | |
account = new Account(); | |
} | |
} | |
@RemoteAction | |
global static wrapperClass executeProcess(wrapperClass arg1) | |
{ | |
System.debug(arg1.account.AccountNumber); | |
return arg1; | |
} | |
} |
<apex:page controller="myClass"> | |
<script> | |
var wrapper = new Object(); | |
wrapper['name'] = 'Test'; | |
wrapper['account'] = new Object(); | |
wrapper['account']['Name'] = 'My Account'; | |
wrapper['account']['AccountNumber'] = '123456789'; | |
myClass.executeProcess(wrapper, function(result, event) | |
{ | |
if(event.type === 'exception') | |
{ | |
console.log(event); | |
return false; | |
} | |
else if(result) | |
{ | |
console.log(result); | |
// do something | |
} | |
else | |
{ | |
console.log(event); | |
} | |
}); | |
</script> | |
</apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment