Skip to Content
author's profile photo Former Member
Former Member

Create standard BO from Script [Clone existing opportunities]

Hello pros,

I have a specific business requirement that I'm not able to implement.

Purpose of the requirement :

ConsiderI have already in base hundreds of opportunities. I would like to create a button that fire a copy of all existing opportunities, or all existing filtered to the previous month.

Things I tried to do :

I created a "dumb/useless" Custom Object with a text field "dummy", created screens using "Screen scenario with thing based navigation" option then I created a BeforeSave script that will fetch for all Opportunities and will recreate them (basically : Opportunity.CreateWithRef(opportunity)).Problem here is not really the code part, but the fact that my script is never called. Tried also other proposed scripts :

They were not firing too.

To ensure that my code was not bugged, I tried a this.dummy = "blablabla" that should replace whats the user typed in the QC. Not working.

Giving up the previous solution, I had a look on the opportunity.owl, and as we cannot modify native screens, I tried to reproduce the following Copy Handler on my custom BO :

The problem here is that you are not allowed to fire Outports in a different namespace of the custom object. You are not allowed to add field from BO located in a different namespace too.

Please, tell me if I'm wrong or if I'm doing something wrong.

Any suggestions, advices, or workarounds would be really appreciated.

Thanks a lot.



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Aug 22, 2016 at 03:58 AM


    You could try any of these:
    1. Create XBO on opportunity and on BeforeSave copy the opportunity

    2. Create Custom BO with Action and in Action query opportunity and create copy

    3. If this activity of copying needs to be done routinely, then you could create MDRO

    Thanks, Pradeep.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.