You need to sign in to do that
Don't have an account?

SaveURL question
Good day,
When i trying to pass in more than one parameter to saveURL, and it does go to right page but do not show more than one paramater in the saveURL. the code sample like below, after the contact save, it should go to 'another' page with parameter show for 'accountName=' and 'modified=true' , but it seem like only appear accountName and newId , but 'modified=true' no longer showing.
PageReference newContactView = new PageReference('/apex/myContact?accountId='+accountId+'&saveURL=/apex/anotherpage?accountName='+accountName + '&modified=true');
Thank you !
You have to URL Encode all the stuff in the SaveURL, otherwise the browser thinks that all the params specified in it are actually just a part of the original URL.
Thanks werewolf !
above is my encode method , and below is how to encode it , but it seem no luck
it give me invalid id error , i have try debug by capture 'accountId', which is actually passing the whole string like
accountid= xxxABCDEF&saveURL=/apex/anotherpage?accountName=Abc corp&created=yes and not xxxABCDEF
any clue on this ?
To help you debug it, you could save the URL you're generating into a separate string and System.debug that.
However I can see what your problem is: you're close, but now you're URLEncoding too much. You don't want to URL encode the part that says &saveURL=, just the actual URL that follows it.