سؤال

Environment : Foundation 2010

I have two helpdesk lists. In List A, the user create the item and an ID is automatically assigned.

My workflow is used to copy that item in the list B. However IDs are not the same (because in some cases some elements are archived). Then I want to keep the same ID on both items.

I see that we can do it with Powershell, but I don't have any access to the Central Administration. Maybe with Client Object Model ? I never use that before.

I tried with lookup field but it doesn't work, as well.

Another way to do that ? It's terrible to see that Sharepoint doesn't even include that functionnality...

EDIT : Here's a screen of which "ID" I'm talking about (ID directly in the list)

enter image description here

EDIT 2 : Here's a screenshot of the update action

enter image description here

هل كانت مفيدة؟

المحلول

Each list keeps its own IDs and you will not be able to keep them perfectly in sync. Create a helper columns and let the workflow copy the ListA ID into that field, then refer to that field as the common ID.

If you use the workflow step "Create item" instead of copying an item, you can transfer any field value from the current item to the new item, as shown in the screenshot, where the Title field in the other list will get the ID of the current item.

enter image description here

Edit I: I think you need to forget about the SharePoint ID and create a unique ID with a workflow. Write that unique ID to a field in List B and then also write that same ID into a field in List A. That way you can identify an item in the other list by the unique ID.

Edit II: Create a helper list (IDNumber) with one item and a number field. This will have the last used unique ID number. Manually set to any number you want as your start number. The ID of this item is easy to find out. Should be 1, if not, look it up.

User creates item in ListA, workflow kicks off, set a variable to the value of IDNumber item where ID = 1 (i.e. look up the last used IDNumber). Use a Calculate step to add 1 to that variable and write to variable NextNumber.

Then write NextNumber to item in ListA, create item in ListB, write NextNumber to item in ListB. Finally set only item in list IDNumber to NextNumber.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top