You need to sign in to do that
Don't have an account?
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
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
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
The forward slash "/" should be URL encoded as a "%2F", is that happening?
Reference here: https://developer.salesforce.com/forums/ForumsMain?id=906F00000008pc4IAA
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!
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}
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!
Rita, congrats on sticking to it and figuring it out! Good luck with the rest of the workbook.
Best, Jason
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
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.