I have a custom button that lives on the Contact page layout that fires a flow when clicked. I'm trying to feed the Contact's Account ID in the parameters so that when the flow finishes, it redirects to the Account page.
var url = ('/flow/[FLOW NAME]?ContactId={!Contact.Id}&retURL={!Account.Id}');
window.open(url);
Problem is, it occasionally seems to feed the wrong Account ID into the URL, resulting in a 404 page.
URL No Longer Exists You have attempted to reach a URL that no longer exists on salesforce.com.
Sometimes it works and sometimes it doesn't -- I can't seem to find a reason either way. I've confirmed that the ones that are failing have valid Accounts they're attached to, so I'm not sure why else it would be fed the incorrect parameter. Any ideas?