function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rita LeverettRita Leverett 

Unable to create flow from Force.com Workbook

Hello.  I'm new to Salesforce and am following the tutorials in the Force.com Workbook.  The lesson is to create a flow to add a Line Item to an existing Invoice when you press a custom button.  Instead of getting a new page for the new Line Item, I get the "URL no longer exists" page.

This is the URL on the error page:

https://na17.salesforce.com/flow/Add_Line_Item_from_Invoice_and_Update_Stock_Quantity%E2%80%8B?vInvoiceId=a01o0000001EMeC&retURL=/a01o0000001EMeC

And this is the URL in the custom Button definition to launch the flow:

/flow/Add_Line_Item_from_Invoice_and_Update_Stock_Quantity?vInvoiceId={!Invoice__c.Id}&saveURL=/{!Invoice__c.Id}&retURL=/{!Invoice__c.Id}

I'm only following the workbook instructions.  I would also appreciate help in finding the exact error message.

Thank You
Best Answer chosen by Rita Leverett
Rita LeverettRita Leverett
Jason,
We're making progress.  Without the retURL, the page launched and updates were made as expected and continues on to the Confirmation page that states the record was created successfully, but now there's no way to get back to the original screen.

I copied the "&saveURL=/{!Invoice__c.Id}", pasted it to the end of the URL, and changed the second "&saveURL" to "&retURL".  It works perfectly now, returning to the original page at the end of the flow.  This looks like the original URL to me but maybe there was something wrong that my poor tired eyes missed.

Thanks so much for your help!

All Answers

Jason Curtis NBSFDGJason Curtis NBSFDG
Hi, Rita, when you click the button what does the URL look like in the browser's address bar? 
The forward slash "/" should be URL encoded as a "%2F", is that happening?
Reference here: https://developer.salesforce.com/forums/ForumsMain?id=906F00000008pc4IAA
Rita LeverettRita Leverett
Hi Jason.  Thanks for your quick response.

No, that is not happening.  I read the reference and I replaced the "/" with "%2F" to get this:

%2Fflow%2FAdd_Line_Item_from_Invoice_and_Update_Stock_Quantity?vInvoiceId={!Invoice__c.Id}&retURL=%2F{!Invoice__c.Id}

Launching the page gets the same error.  This is the URL:

https://na17.salesforce.com/servlet/%2Fflow%2FAdd_Line_Item_from_Invoice_and_Update_Stock_Quantity?vInvoiceId=a01o0000001EMeC&retURL=%2Fa01o0000001EMeC

As you can see, "https://na17.salesforce.com/servlet/" is automatically prefixed to the URL.  I noticed "servlet/" now appears in the URL where it didn't before.

No one has ever had any problem with this tutorial?  It will be very short career for me if I can't do this simple thing!
Jason Curtis NBSFDGJason Curtis NBSFDG
Rita, don't give up!
Couple of things to check:
Make sure your flow is named correctly. Also, make sure the unique name matches but with underscores between the words.
Make sure the flow Is Active.

Also, if the above are OK, try modifying the URL on the button to not have a retURL, like this: /flow/Add_Line_Item_from_Invoice_and_Update_Stock_Quantity?vInvoiceId={!Invoice__c.Id}&saveURL=/{!Invoice__c.Id}


Rita LeverettRita Leverett
Jason,
We're making progress.  Without the retURL, the page launched and updates were made as expected and continues on to the Confirmation page that states the record was created successfully, but now there's no way to get back to the original screen.

I copied the "&saveURL=/{!Invoice__c.Id}", pasted it to the end of the URL, and changed the second "&saveURL" to "&retURL".  It works perfectly now, returning to the original page at the end of the flow.  This looks like the original URL to me but maybe there was something wrong that my poor tired eyes missed.

Thanks so much for your help!
This was selected as the best answer
Jason Curtis NBSFDGJason Curtis NBSFDG

Rita, congrats on sticking to it and figuring it out! Good luck with the rest of the workbook.
Best, Jason

Richard KaoRichard Kao
Thanks Rita and Jason for figuring all of this out. I just came up with this problem too and wasn't sure at all how to fix it. Is it just an outdated lesson in the force.com workbook that they need to fix? I'm new to Salesforce and trying to learn it and I don't understand the code at all
Andrew R.Andrew R.
This drove me crazy also.

The below URL will work perfectly:
/flow/Add_Line_Item_from_Invoice_and_Update_Stock_Quantity?vInvoiceId={!Invoice__c.Id}&retURL=/{!Invoice__c.Id}

For the curious, the problem occurs when you copy and paste the URL from the Force.com workbook. For whatever reason it includes 3 extra extended ASCII characters in the URL just before the first '?' that aren't visible in a plain text box. This causes the URL to fail when it's triggered by the Salesforce button.

You can repair the URL by placing the cursor to the left of the '?' and hitting delete. Not sure how this happens but I had to get to the bottom of it once I saw that both URLs looked identical yet one worked and the other did not!

Hope this clears up some confusion for some people.

Cheers,
Andy
jjfd jifdjjfd jifd
On copying URL directly from workbook,it was giving me error.When i checked the encoded url it was giving me below:
https://ap2.salesforce.com/flow/Add_Line_Item_from_Invoice_and_Update_Stock_Quantity%E2%80%8B?vInvoiceId=a0228000000gh46&retURL=/a0228000000gh46
From URL i came to know before question mark "?" there are some characters which is getting encoded.So i copy paste the URL on notepad and again copied.Then it worked fine for me.
Thanks Andy! Your comment helped me to find out the bug.
Tazur RahmanTazur Rahman
This drove me nuts for a while, I was going back and forth, trying to find any errors that I've made. Thanks Andrew R.