You need to sign in to do that
Don't have an account?
Lalitha Selvaraj
pass apexpage message as parameter to pagereference
Hi i have a custom button on detai page.On click opens a VF page - where i have a save button.
On click of save , it inserts sme records. so after that i have to return to detail page.which i can.
But i want is the "Thank You! (n) Records inserted" some thing like this message.
On click of save , it inserts sme records. so after that i have to return to detail page.which i can.
But i want is the "Thank You! (n) Records inserted" some thing like this message.
try this-
Thanks
Rupal kumar
http://Mirketa.com
Page code :
<input type="button" value="saveRecord" onclick="saveRecord()" />
<script type="text/javascript">
function saveRecord() {
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.ControllerName.saveRecord}'
function(result, event){
if (event.status) {
// alert here to show the count of records inserted ( result.size )
// use setTimer javascript method to redirect to the detail page with certain delay( setTimeout(function(){ javascript for page redirection }, 3000);)
} else if (event.type === 'exception') {
...
} else {
.....
},
{escape: true}
);
}
</script>
Controller code :
public static List<Account> lstAccounts { get; set; }
@RemoteAction
global static List<Account> saveRecord() {
lstAccounts = [SELECT Id, Name, Phone, Type, NumberOfEmployees
FROM Account ...];
return lstAccounts;
}
Rupal kumar