locked
Allow attachment of file to note. But do not allow update of Subject and Description... Help. RRS feed

  • Question

  • Hi everyone,

    Problem (CRM 2013):

    On the case Entity we have associated notes.

    Admin users have full access regarding, updating, creating and associating files to a note.

    However, some users have limited access. They can create notes but can't delete or modify.

    Business process is that non admin users need the ability to attach a file to an existing note. However, they can not modify already created notes.

    I don't think this is achievable using security roles.

    At the moment the non admin users are sending files to the admin users to attach to the notes. This is cumbersome and we want this rectified soon.

    Anyone experienced this problem before?

    How can I get around this problem without little development time as possible?



    • Edited by davdatong Monday, April 7, 2014 11:09 PM
    Friday, April 4, 2014 11:00 AM

All replies

  • Is there no solution to this problem?
    Monday, April 7, 2014 11:09 PM
  • Hi,

    You can definitely control this using security role don't provide your user create permission but just provide then write permission so that will be able to edit only, they can't create it like below

    HTH


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Tuesday, April 8, 2014 12:16 AM
    Moderator
  • You are correct!  Allowing a user to attach files to existing notes requires WRITE privilege on notes... that would leave the notes field also editable. You cannot control this with security roles only.

    You can use a pre-update plugin to check if the notes is updated and abort the update. This should not take long for a developer.


    If my response helps you in finding your answer then please click 'Mark as Answer' and 'Vote as Helpful'

    • Proposed as answer by Mamatha Swamy Tuesday, April 8, 2014 4:34 AM
    Tuesday, April 8, 2014 4:33 AM
  • Ohh sorry It seems I misunderstand, I thought you are looking for user should not be able to create but should be able to modify it. you have to control it through plugins.

    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Tuesday, April 8, 2014 5:27 AM
    Moderator
  • Hi,

    Thanks for the responses.

    I have decided with the plugin route.

    I have registered the plugin on pre-validation of note.

    However, I am on the case form. When a user updates the description or subject I can't seem to get the context with the input parameters as I am on the case form.

    Entity note = (Entity)localContext.PluginExecutionContext.InputParameters["Target"];
    
    if (note.Contains("subject"))
    {
    tracingService.Trace("Subject has been updated");
    
    throw new InvalidPluginExecutionException ("You cannot update the note");
    }
    if (note.Contains("notetext"))
    {
    throw new InvalidPluginExecutionException ("You cannot update the note");
    }

    Works fine when I am on the note entity. However can't seem to trigger when I am on the case entity and updating the notes that way.

    Any ideas?


    • Edited by davdatong Tuesday, April 8, 2014 9:15 AM
    Tuesday, April 8, 2014 9:14 AM
  • Anyone know if this is possible?
    Thursday, April 10, 2014 8:04 AM
  • As you have registered your plugin on annotation, it should always work when you will do any changes in notes ?? it does not matter on which entity you are but if you are dong changes in notes directly you plugin should fire. Could you provide some more details about registration and how you are testing it.

    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Thursday, April 10, 2014 8:31 AM
    Moderator
  • I just tested it with a sync workflow registered on Note change, to cancel the workflow and display an error message.

    It works, but the user experience isn't very nice on the new UI forms... 

    Another idea for you to explore would be to use a plugin to copy the contents of the "modified" note into a new note, and leave the previous note untouched, essentially cloning the note, instead of directly updating it. This way the user experience is clean, and you can keep all the history as well.

    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism

    Thursday, April 10, 2014 9:02 AM