0

Currently I have two lists I'll call Parent and Child.

  • The Parent auto-populates Child when new item is added (4 columns).
  • The Child contains identical columns as the Parent plus 6 additional columns.

This is what I would like to do and not sure how to tackle it with SharePoint and Designer 2010. I'm guessing I should create a combined list but they need to interact with each other.

The below only refers to users of the Child list unless otherwise stated.

  1. Once the Child list is auto-populated with an item, allow users to complete the other 6 empty fields for that same populated record.
  2. Reference #1: Prevent users from editing the 4 auto-populated items from the Parent
    • However, when a condition is met (selecting a dropdown, etc.), instead of Parent populating the 4 fields in Child, users would be allowed to create a new independent item and enter data in all 10 fields of the Child.
      • Then, the newly created item would reverse auto-populate Parent with the same 4 fields
  3. Anytime data is entered in one of the Child columns named XXX, it auto-populates Parent (same column name)

1 Answer 1

0

You can do this either using an EventReceiver or using a SharePoint workflow.

First you need to make couple of adjustments to your list schema.

  1. Add a new hidden field in the Child and call it ParentID. Whenever you populate the child - You should get the Parent Item ID and populate the Child's ParentID field.

Now the logic

  1. Attach a Workflow into Parent. Let it start automatically on item create
  2. On item create - Add an Activity to create a new item in Child. Populate 5 fields including ParentID

  3. Attach another workflow in Child. Let it start automatically on item create

  4. Now you need to identify whether the item was created by - Parent Workflow or By the user (Based on you 2.a). For that you just need to look into the ParentID field. If its being create by User, then that field will not have any values
  5. If user is creating the item, then create a new item in Parent List and populate the values

Next is about disabling the form controls. For that you can either use JavaScript or you can create a custom InfoPath form. In that Form you can create rules to enable/disable controls.

9
  • Thank you Amal. I think I generally understand what you are saying and will start looking into it. I don't know programming so will use InfoPath but suspect I will have more questions later.
    – Zippy
    Jan 23, 2015 at 15:33
  • I'm looking for a little more clarification please. Reference #2 above: Not sure if I'm doing this correctly but in my workflow I used "Create List Item" and matched the fields. This is the only entry in my workflow and appears to create the item in the Child, but how do I update the item so that it doesn't create a new list item? This same workflow uses the default Output to Variable: create. Do I need to use this somewhere? Previously I used a workflow to copy the Parent to Child.
    – Zippy
    Jan 26, 2015 at 18:08
  • @Zippy while populating i believe you are also filling the parentid, so just make sure the parent id exists in the child list. if exists update that item, else insert new. Jan 26, 2015 at 18:12
  • Amal...Yes, I am using the ID field from Parent to update the field ParentID in Child. However, I don't see where I have a choice to update vs. insert new. If I modify the item in a Parent form or Datasheet view, the workflow creates a new record.
    – Zippy
    Jan 26, 2015 at 18:37
  • Use the Update List item activity - If already exists Jan 26, 2015 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.