How to Return PageReference from a webservice method
In your Class use a String as a Returntype
and create your reference like this in your webservice class
and in your Button, you have to catch your return String and reload the page:
and create your reference like this in your webservice class
1
| return String.valueOf( new PageReference('/'+Case.Id).getUrl()); |
1
2
| var newurl = sforce.apex.execute("TestClass","CreateTestRecords", {id:"{!Case.Id}"}); parent.location.href = newurl; //refresh the page |
No comments:
Post a Comment