0

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?

1

Try this:

../flow/[FLOW NAME]?ContactId={!Contact.Id}&retURL=/{!Account.Id}

(The .. allows your Flow button to work in a Community)

You might be missing the "/" in your retURL?

  • Didn't seem to help. The problem seems to be that the {!Account.Id} variable is pulling in the wrong ID entirely. For example, the test contact I'm using is attached to an Account with ID "001A000001DXb7a" but the ID the button is pulling is "5130f0a58989846a3602f64c" -- I've verified this isn't something happening later in the process by just trying a simple alert('{!Account.Id}'); script also (it shows the wrong ID in this case too). – Matt Aug 2 '16 at 17:17
  • Is the variable coming into the Flow correctly? Or is it from the start of your Flow pulling a different ID? – David Litton Aug 2 '16 at 23:40
  • No, it's not coming into the Flow correctly -- my example above was the variable for the Account ID should be "001A000001DXb7a" but instead it's going into the Flow as "5130f0a58989846a3602f64c" – Matt Aug 3 '16 at 3:47
  • Can you try this with just a straight URL instead of using the script? – David Litton Aug 3 '16 at 3:55
  • 1
    Have you tried creating a custom account ID field on the Contact? Lame, but maybe that standard merge field has some issue – David Litton Aug 3 '16 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.