locked
Privilege to activate quot in Dynamics CRM 2011 RRS feed

  • Question

  • Hello, everyone.

    In Dynamics CRM 2011, is there a privilege I can use to control whether a user can activate a quot?

    If not, how can I do that with some customizations?

    I want to allow the salesperson to only create a quot, and sales manager to activate the quot.

    Best regards


    希意禧(上海)系统有限公司 CRM销售顾问 guochuangang@cec-ltd.cn 我们为在中日企提供专业的ERP和CRM解决方案,有兴趣请电邮查询。 シーイーシー(上海) CRM営業コンサルタント guochuangang@cec-ltd.cn弊社は在中日系企業に専門的なERPやCRMソリューションをご提供します。お気軽にメールください。 http://blog.vsharing.com/guo_crm/
    Friday, July 1, 2011 6:23 PM

Answers

  • Hi,

    As there is no standard feature available to control so the best way to control Quote Activation priveleges is via registering a plugin on SetStateDynamicEntity Message for Quote entity in Pre-Operaiton stage, the plugin code should check if Quote is activated and specified user or user with specified Security Role or having entity privelege is activating quote then allow execution else abort execution and throw exception, in plugin your code will be i.e.

    // Check if Quote Entity is activated

    if (context.InputParameters.Contains("EntityMoniker") && context.InputParameters["EntityMoniker"] is EntityReference &&
        ((EntityReference)context.InputParameters["EntityMoniker"]).LogicalName == "quote") {
        switch (context.MessageName)
        {

        // Check if entity status is changed
        case "SetStateDynamicEntity":

        #region Configuraiton Activation Safe Check
        if (context.InputParameters.Contains("State"))
        {

         // Check if User has Activated the Quote
         if (((OptionSetValue)context.InputParameters["State"]).Value == 1)
            {
                 // Check if current user does not have Privillages then throw exception

                 throw new InvalidPluginExecutionException("Not enough privelegs to activate quote.");
         
            }
         }
    }


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".


    Friday, July 1, 2011 7:16 PM
  • Hi,

    An alternative approach is to customize the ribbon to disable the quote activation button by security role. You could investigate adapting the example posted in the below link to control the activate quote button instead of the activate/de-activate record buttons. http://www.gapconsulting.co.uk/Blog/DynamicsCRM/archive/2011/06/16/control-activate-and-deactivate-buttons-by-security-role-using-a.aspx

    Rob


    Microsoft Certified Technology Specialist (CRM) GAP Consulting Ltd Microsoft Community Contributor Award 2011
    • Proposed as answer by Rob BoyersEditor Friday, July 1, 2011 7:58 PM
    • Marked as answer by Leo_GUO Monday, July 4, 2011 1:12 AM
    Friday, July 1, 2011 7:58 PM
    Answerer

All replies

  • Hi,

    As there is no standard feature available to control so the best way to control Quote Activation priveleges is via registering a plugin on SetStateDynamicEntity Message for Quote entity in Pre-Operaiton stage, the plugin code should check if Quote is activated and specified user or user with specified Security Role or having entity privelege is activating quote then allow execution else abort execution and throw exception, in plugin your code will be i.e.

    // Check if Quote Entity is activated

    if (context.InputParameters.Contains("EntityMoniker") && context.InputParameters["EntityMoniker"] is EntityReference &&
        ((EntityReference)context.InputParameters["EntityMoniker"]).LogicalName == "quote") {
        switch (context.MessageName)
        {

        // Check if entity status is changed
        case "SetStateDynamicEntity":

        #region Configuraiton Activation Safe Check
        if (context.InputParameters.Contains("State"))
        {

         // Check if User has Activated the Quote
         if (((OptionSetValue)context.InputParameters["State"]).Value == 1)
            {
                 // Check if current user does not have Privillages then throw exception

                 throw new InvalidPluginExecutionException("Not enough privelegs to activate quote.");
         
            }
         }
    }


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".


    Friday, July 1, 2011 7:16 PM
  • Hi,

    An alternative approach is to customize the ribbon to disable the quote activation button by security role. You could investigate adapting the example posted in the below link to control the activate quote button instead of the activate/de-activate record buttons. http://www.gapconsulting.co.uk/Blog/DynamicsCRM/archive/2011/06/16/control-activate-and-deactivate-buttons-by-security-role-using-a.aspx

    Rob


    Microsoft Certified Technology Specialist (CRM) GAP Consulting Ltd Microsoft Community Contributor Award 2011
    • Proposed as answer by Rob BoyersEditor Friday, July 1, 2011 7:58 PM
    • Marked as answer by Leo_GUO Monday, July 4, 2011 1:12 AM
    Friday, July 1, 2011 7:58 PM
    Answerer
  • Great suggestions. I actually did a combination of the two in the past. I would be awesome (and maybe to much to ask for to Microsoft) to have a new "SetState" privilege for all entities instead of relying on the Update privilege...this seems to be very common scenario.

    Gonzalo | gonzaloruizcrm.blogspot.com

    Friday, July 1, 2011 9:52 PM
    Moderator
  • Thank you all for your kind reply.

    Best regards.


    希意禧(上海)系统有限公司 CRM销售顾问 guochuangang@cec-ltd.cn 我们为在中日企提供专业的ERP和CRM解决方案,有兴趣请电邮查询。 シーイーシー(上海) CRM営業コンサルタント guochuangang@cec-ltd.cn弊社は在中日系企業に専門的なERPやCRMソリューションをご提供します。お気軽にメールください。 http://blog.vsharing.com/guo_crm/
    Monday, July 4, 2011 1:13 AM
  • Hi Gonzalo,

    I added this to connect and was informed that I should vote for this suggestion:

    https://connect.microsoft.com/dynamicssuggestions/feedback/details/664672/user-rights-to-update-accounts-but-not-de-activate-them

    So lets add our votes to this and get 'SetState' made part of the security role privileges!

    Rob


    Microsoft Certified Technology Specialist (CRM) GAP Consulting Ltd Microsoft Community Contributor Award 2011
    Tuesday, July 5, 2011 11:47 AM
    Answerer