Question

How to stop Redirection From " New Order" section in Opportunity?

Hi,

Whenever we created a "NEW ORDER " from opportunity section it will goes to order section and create a order  after it will come back to opportunity section but i need to  stop at order section .   

How can I achieve it?Please find below picture.

 

 

regards,

Suresh G.

Like 0

Like

3 comments

Dear Suresh,

The basic logic is made that way, that when you open an edit page (to create or edit), once you hit "Save" you are redirected back to the place you have been.

In order to change this basic logic, we need to override save method. Since you want it for the Order page, therefore, you need to work within OrderPageV2 schema. Merge the realization of the save button (diff) and bind its click on to your custom method. You can also add a check for whether this is a process mode, so to apply separate save logic only for processes. In custom method you may create any save realization you need. Here is an example, which does not close the page, but stays on it after save. This is achieved by passing a silent save parameter to the save function.

onSaveButtonClick: function() {
   if (this.get("IsProcessMode")) {
      this.save({ isSilent: true });
   } else {
      this.save();
   }
} 

Regards,

Anastasia

Anastasia Botezat,

 

This works perfectly fine but because of the mentioned changes the Process won't finish.

Is there any possible way to finish the process, by using a different process or within the above settings.

 

I also tried this code but the result is the same the process remains in the running state.

this.sandbox.publish("PushHistoryState", {hash: "SectionModuleV2/OrderSectionV2/"});

 

Syed Ali Hassan Shah,

 

the order page that is opened after clicking the "New order" button is indeed a process page (in terms of the "Add order based on opportunity" business process execution). This is the correct logic that the user is redirected back to the opportunity page once the process is completed since the last element of the "Add order based on opportunity" business process is "Open edit page" element. Once the save button is hit the process completes its execution. So you need to get sure that all the changes in the created order are applied and only then save the record.

Show all comments