Close Opportunity page before opening order

Dear mates,

Can i close the opportunity page in a process  ?

When an opportunity is closed and won, an order page opens automatically.
As soon as the user save the order, the order page close and the user returns to the opportunity.

I would like he stays on the order when he save it and i would like to close the opportunity too.

How can i do this ?

Thank you

Nicolas

Like 0

Like

8 comments

Dear Nicolas,

 

As of now, this can be achieved only via development. You can find examples of this implementation on community: https://community.creatio.com/questions/how-stop-redirection-new-order-section-opportunity
https://community.creatio.com/questions/stay-child-record-while-creating-it-parent

 

Best regards,

Max.

Dear Max,

 

i override  the Save method and i modify my autosave method and it works fine i stay on the order where the order is saved.

 

But when i add a product to the order, the order is saved and it go back to the opportunity.

 

Do you know where the save method is call in this case ?

In my orderproduct detail, there is a save button:

 

Shall i override the save method of the orderproduct detail ?

 

Thank you !

Nicolas

 

 

LÉZORAY Nicolas,

 

Hi,

 

You will need to override the _navigateBack method (that is called by the afterSave method) of the ProductSelectionSchema schema. This method publishes the "BackHistoryState" message via sandbox and is responsible for pushing the user back in the history.

 

Best regards,

Oscar

Oscar Dylan,

Hi Oscar,

So i have to replace the ProductSelectionSchema.

In the documentation, i have to used "Replacing Client Module":

 

But i cann't find it in my system:

 

What must i used to replace ProductSelectionSchema ?

 

Thank you !

Nicolas

LÉZORAY Nicolas,

 

You need to use a replacing view model.

 

Best regards,

Oscar

Oscar Dylan,

Thank you Oscar,

 

i overrided the ProductSelectionSchema _navigateBack method.

i commented the line: this.sandbox.publish("BackHistoryState");

 

Now when i save the product in my orderproduct detail, i stay on the orderproduct selection page. how can i close the detail page to go back into the order ?

Oscar Dylan,

by overloading the _navigateBack method, I haven't found a way to close the product details page without the order also closing.

LÉZORAY Nicolas,

Override de productselectionschema:

 

            methods: {
                /**
                 * Additional processing after products saving.
                 * @protected
                 */
                afterSave: function(args) {
                    this.sandbox.publish("ProductSelectionSave", this.findSelectedProducts(), [this.sandbox.id]);
                    this.UsrnavigateBack();
                    this.hideBodyMask();
                },
                /**
                 * @protected
                 */
                UsrnavigateBack: function() {
                    var isOpportunityPage = window.location.href.indexOf("OpportunityPageV2") > 0;
                    if(!isOpportunityPage) {
                        this.sandbox.publish("BackHistoryState");                        
                        this.set("IsPageClosed", true);
                    } else {
                        this.config = this.sandbox.publish("ProductSelectionInfo", null, [this.sandbox.id]) || {};
                        window.location.assign("ViewModule.aspx#CardModuleV2/OrderPageV2/edit/"  + this.config.masterRecordId);
                    }
                },
            }

 

and it works !

even if at the end the user pust close two times the opportunity

Show all comments