+ Start a Discussion
Jane Marchand 15Jane Marchand 15 

Order Product Custom Clone Button

Hi
I am trying to create a custom clone button on Order Product.

The code I am using is as follows
/{!OrderItem.Id}/e?clone=1

All appears to function correctly until such time as I try to save this new record. I then get the following error:

User-added image
Of which the URL is: https://cs81.salesforce.com/802/e

Is there any way I could reference the OrderId in the RetURL? I think that may fix the problem.

Thanks

Jane
 
Tejpal KumawatTejpal Kumawat
Hello Jane,

You need to add &retURL={!OrderItem.OrderId} in the button URL.

Regards
Tej Pal Kumawat
Skype : tejpalkumawat1991

If this answers your question mark Best Answer it as solution and then hit Like!
Jane Marchand 15Jane Marchand 15
Hi Tejpal

I tried that but getting an error in the formula builder.
See below.
I also tried changing the RetURL to be &retURL={!OrderItem.Order.Id} but get the same error....

User-added image

&retURL={!OrderItem.OrderId}
pbattissonpbattisson
You want to add the retUrl parameter to your URL
 
/{!OrderItem.Id}/e?clone=1&retURL=%2F{!OrderItem.Id}

You can read a great blog about this here (http://agilecloudconsulting.blogspot.co.uk/2013/08/customizing-standard-clone-button.html)
Jane Marchand 15Jane Marchand 15
I'm afraid that does not work either....
pbattissonpbattisson
What about the suggestion doesn not work?
Jane Marchand 15Jane Marchand 15
I'm getting the same URL No Longer Exists error as above
Have you tried it in an org? Is it working for you?

Thanks
AshlekhAshlekh
Hi,

You can write below code and select java script behaviour.

window.location.href = '/{orderitem.id}/e?clone=1&retURL=%2F{orderitem.id}&isdtp=mn';

-Thanka
Ashlekh Gera
Irene SlessIrene Sless
Jane, did you get this work? I've tried all the suggestions I've found, but none of them work. It just doesn't seem to clone the OrderItem - the links given only open the OrderItem selected in edit mode, not as a New OrderItem cloned from the original to be saved. The retURL part was easy to fix, it's the cloning that doesn't work for me...
Mina Michel GorgyMina Michel Gorgy
Hi Irene Sless, looks like you're right. Did you find a workaround for it? I'll be still looking until I find a way out. Let me know please.