Parent - Child - Add new but not existing Child records RRS feed

  • Question

  • User A is the owner of Parent. 

    User B should be able to create new child records for the Parent. However, he/she should not be able to add existing child records. I could disable the icon for "Add Existing" child record.  I don't want to manipulate the Ribbon. Is it possible to achieve via security permissions? 

    • Edited by CRM elite Wednesday, May 9, 2012 12:08 AM
    Wednesday, May 9, 2012 12:07 AM

All replies

  • Hello CRM elite:

    For parent-chilld relationship, you need to store the Parent guid in child records.So this is not possible for older records

    For existing records, you can not achieve this from the UI. If you have the option to delete the older records then delete them else you can follow the following steps:

    1. Go to the database of your CRM organization

    2. Go to the desired child entity table and select the desired records where you want to set the parent guid

    3. Using SQL query, update the parent guid in defaulter child records relationship field.

    If you have any confusion in this implementation, let me know.

    It will work for sure.....enjoy..:)

    Saurabh Gupta, MS CRM 2011 Software Development Engineer

    Wednesday, May 9, 2012 6:34 AM
  • Hi Saurabh, thanks for your feedback. I have set this type of set up for a child entity relating to another entity. Here is what I would want: 

    Say, Sales Manager (User A) create a parent A, that can be viewed by his Sales Reps (subs).

    Reps (user B) can be able to add child records to the Parent A.  user B, can open the Record A ie. I could place a grid in the Parent Form where user B can add new child records.

    User B is the owner of the child record; while user B can add new child, he should be prevented from adding an existing one. Also, should be prevented from de-activating the child record.

    Once after the user B adds all the child records, user B, then updates the status on the Parent, say status reason = "completed"; <perhaps I could set up a field security so User B can be able to update the status reason only>

    Once the status reason is set to completed, the child records should be in a locked state for User B. 

    After User A, reviews the child records and set "appoved" on the status reason at the Parent level, the child records should become "Inactive". User B can only view the child records in deactive state; as well as the parent record;  

    What I am trying to achieve is that - Sales Manger, overseas about 5 reps in the East region; He would like to collect sales activity of each user for a given week - it may have some specific tasks assigned to him. For a given week, the sales manager, could view list of tasks that each rep has performed by looking at the parent record for each Rep. Also there are some calculations that need to summed up at the parent level for each reps. so they will be entering some financial information and targets etc., for each week.. If there is a better way to achieve, appreciate anyone could share their thoughts and feedback.  

    • Edited by CRM elite Thursday, May 10, 2012 2:09 AM update
    Thursday, May 10, 2012 2:02 AM
  • This cannot be done through Security Roles alone.

    The setting of the child records to be inactive once the parent record is "Approved", has to be done through a custom plugin.

    Dimaz Pramudya - CRM Developer - CSG (Melbourne) www.xrmbits.com http://twitter.com/xrmbits

    Thursday, May 10, 2012 2:12 AM
  • how about the other requirements - what will be the optimal security settings to fulfill the rest of the requirements. 
    Thursday, May 10, 2012 8:24 PM
  • Hello CRM elite:

    Regarding your first requirement "Once the status reason is set to completed, the child records should be in a locked state for User B. ".

    You can easily achieve this by using OData service (REST) in the CRM form. Simply on change of the Parent status, call a function that will perform the OData UPDATE operation on all the associated child records and make them inactive.

    If you feel any confusion in achieving this, let me know, I can help you in implementation. 

    Regarding "User B can only view the child records in deactivate state; as well as the parent record;" this requirement,

    This can be easily achieved by using the custom views rather than CRM views. You have to override the view's fetch XML and put the filter criteria as "child records status == deactivate state".

    First pin-down the approaches and confirm them. Then we can go with implementation...:)

    Saurabh Gupta, MS CRM 2011 Software Development Engineer

    Monday, May 14, 2012 5:50 AM