Thomas
Thomas

Reputation: 101

ms crm 2011 reload new window

I've copied a quote (with all quotedetails) and open it in an new window. Now I want to reload the new window to recalculate total amount of the new quote.

How can I reload the new window? If I put it in Onload of a window then I have an endless loop, because the window is reloading all the time.

Which is the best way to do this ?

Many thanks in advance!

Upvotes: 2

Views: 154

Answers (1)

Konrad Viltersten
Konrad Viltersten

Reputation: 39190

It shouldn't be reloading all the time. Not unless you call for it. Although, if you perform a save operation, a reload will be executed to refresh the frame. You're sparse with the details but I'm guessing that you want to recalculate the values on load but not store them.

In case you'd like to store the values directly after calculations have been performed (as opposed to letting the user click save), you can invoke save() method. And the right place to invoke calculations would in my view be in onchange() for the field(s) that you copy the values to.

Ultimately, there are two more approaches. The first is creating a plugin that will fire just before you retrieve an instance and populate the fields.

The other, and this is just a guess, would be adding a new button to the ribbon. We've done that a few months ago. In addition to save&new we also have now save&copy, which saves the current form to the database and opens a new one with pre-populated values from the newly closed one.

Upvotes: 1

Related Questions