locked
Changing/Editing the Revise Quote RRS feed

  • Question

  • Hello,

    I am looking for a way to change/edit the Revise Quote functionality in CRM.

    Quote entity on my instance has one custom lookup field (lookupA). When I click on "Revise" on the ribbon button, CRM creates another Quote record with the same Quote Id and copies all the values from the current quote record to the revised quote record. However, I don't want to copy over the custom lookup field (lookupA) when revision happens.

    Is there a way to do so? How?

    I have doubts myself about the revise quote functionality. Please advice if my understanding of revise quote is incorrect.

    Thanks,

    Swaroop

    Thursday, August 6, 2015 8:21 PM

Answers

  • Hello,

    I've done that before. Solution is following:

    1. Develop a pluging that will handle Create message in Pre-Operation(20) mode.

    2. Code will look like following:

                if (localContext.PluginExecutionContext.ParentContext == null || localContext.PluginExecutionContext.ParentContext.MessageName != "Revise")
                	return;
    
                Entity target = localContext.PluginExecutionContext.InputParameters["Target"] as Entity;
    
                if (target.Contains("yourcustomfield"))
                {
                    target["yourcustomfield"] = null;
                }


    Dynamics CRM MVP
    My blog

    • Marked as answer by Swaroop_d Friday, September 11, 2015 3:36 PM
    Friday, August 7, 2015 4:28 AM
    Moderator

All replies

  • Hello,

    I've done that before. Solution is following:

    1. Develop a pluging that will handle Create message in Pre-Operation(20) mode.

    2. Code will look like following:

                if (localContext.PluginExecutionContext.ParentContext == null || localContext.PluginExecutionContext.ParentContext.MessageName != "Revise")
                	return;
    
                Entity target = localContext.PluginExecutionContext.InputParameters["Target"] as Entity;
    
                if (target.Contains("yourcustomfield"))
                {
                    target["yourcustomfield"] = null;
                }


    Dynamics CRM MVP
    My blog

    • Marked as answer by Swaroop_d Friday, September 11, 2015 3:36 PM
    Friday, August 7, 2015 4:28 AM
    Moderator
  • Hi Andrii,

    This worked for me. Thanks a lot !!

    Regards,

    Swaroop

    Friday, September 11, 2015 3:36 PM