locked
Close Quote window when Revise selected from the Actions menu? RRS feed

  • Question

  • Is there a way to :

    Close Quote window when Revise selected from the Actions menu?

    We have a WF that runs when a quote is revised, but users are not closing the quote and waiting for the WF to run.  If I closed the revised quote, there would be plenty of time for teh WF to run.

    As a side question, is there a Javascript way to tell if the form is of a revised quote?  Maybe I can do that instead of a WF. Or tie into the revise function and make my changes?


    Withers *Check out my javascript working examples on my blog http://withersblog.withersdavid.com/
    Wednesday, September 8, 2010 6:25 PM

Answers

  • I see.

    Well...why not use an onLoad-script instead on the quote? Check the revision-ID and if it's not 0, you have a revised quote. Then run your script. It will instantly be there when the new quote is open and the user can see what the workflow did.

    I wouldn't use a workflow for this, because an asynchronous workflow is not really suited for interacting with a user like that.

    • Marked as answer by David Withers Friday, September 10, 2010 6:39 PM
    Thursday, September 9, 2010 3:33 PM

All replies

  • Regarding your side question: You can always read out the value of the revision ID-field on the quote.

    Other than that: Do I understand you correctly that you want to start a workflow as soon as the user clicks "revise"? Does this workflow modify the current quote (that is about to be closed) or the new quote (that is about to be created) or neither?

    Because I see some logical problems here. An old quote is usually closed and therefore cannot be modified anymore and the new quote doesn't exist yet AND you have no way of knowing which one it is (from within the workflow at least).

    Thursday, September 9, 2010 7:17 AM
  • Hi David,

    You can easily know get the revision Id using javascipt as the default value is 0 and if a quote is revised once than it is 1 and so on. You may use the condition (crmForm.all.revisionid.DataValue >=1)

    {

    crmForm.SaveAndClose();

    }

    You can also trigger the workflow on change of revision id where it is greater than equal to one.

    Regards

    Faisal

    Thursday, September 9, 2010 9:12 AM
  • First, thank you for the responses! :)

    I guess I should clarify:

    User has an active quote they want to change

    They select Revise

    Instantly CRM pops up an identical copy of the Active quote. (Revision)

    Meanwhile we have a workflow updates the revised quote in the background.  Since there is a short delay for the workflow to execute and the instant revision being loaded; the user will never see the changes the workflow made.

     

     

    So I need to either close the revised quote when loaded using something similar to crmForm.SaveAndClose(); and maybe a hidden bit field to avoid an infinite loop. Thus giving the workflow a chance to run since they will have to locate and open the revised quote.

     

    Or I need to some how tie into the revision function and set the fields during that process.


    Withers *Check out my javascript working examples on my blog http://withersblog.withersdavid.com/
    Thursday, September 9, 2010 3:23 PM
  • I see.

    Well...why not use an onLoad-script instead on the quote? Check the revision-ID and if it's not 0, you have a revised quote. Then run your script. It will instantly be there when the new quote is open and the user can see what the workflow did.

    I wouldn't use a workflow for this, because an asynchronous workflow is not really suited for interacting with a user like that.

    • Marked as answer by David Withers Friday, September 10, 2010 6:39 PM
    Thursday, September 9, 2010 3:33 PM
  • I'm going to have to agree with aziegler on this and suggest that using a Workflow to perform the updates on the "revised" quote record is not going to be as expedient as a more synchronous process.  Instead of using an OnLoad script, you could use a Plug-in that triggers on the Create message for the Quote entity, that would examine the revision information and make necessary changes.  (The ReviseQuote message is not listed in the messages that are available for Plug-in attachment.)  Otherwise, I don't see how it's easier, or more expedient to alter the revision process with a custom one, simply to allow it to wait for a Workflow to finish executing.  What if the Workflow encounters a problem, or the Async Processing service stops running?
    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Thursday, September 9, 2010 5:07 PM
    Moderator