Copy item from List A to List B, generate 2 rows in List B

Hi, 
I would like to copy and update items from List A to List B. However, I want the item to be duplicated in List B.
I will explain my scenario
- List A contains a People Picker column of multiple selection and a Title column
- When the form is submitted, a workflow should trigger to copy the item to List B. If the People Picker column contains 2 values inside it, for example, user1;user2. The copied item should be duplicated in rows according to the number of users.
Example
Columns   Title, Users, ID
List A - TicketNo1, User1; User2, 1
List B - TicketNo1, User1              1
List B - TicketNo1, User2              1
Can this be done OOTB or must we use some event receiver..has anyone ever done such a thing before?

Hi,
Below code help you to accomplish your task using event receiver
public
override void ItemAdded(SPItemEventProperties properties)
//base.ItemAdded(properties);
if (properties.ListTitle ==
"ListA")
SPUser user = null;
//get value of fields
string strTitle = Convert.ToString(properties.ListItem["Title"]);
SPFieldUser userField = (SPFieldUser)properties.ListItem.Fields.GetField("TaskAssignUser");
SPFieldUserValueCollection fieldcollectionValue = (SPFieldUserValueCollection)userField.GetFieldValue(Convert.ToString(properties.ListItem["TaskAssignUser"]));
foreach (SPFieldUserValue fieldValue
in fieldcollectionValue)
                   user = fieldValue.User;
                   //Create items in another list
SPList destinationList = properties.Web.Lists["ListB"];
SPListItem targetItem = destinationList.Items.Add();
                   targetItem["Title"] = strTitle;
                   targetItem["WorkAssigned"] = user;
                   targetItem.Update();
Thank You,
Somnath Matere

Similar Messages

  • How to drag and drop item from list to another item in list and change their positions

    I have a list field with multiple items. I want to select one item from list and drag and drop to another item in the list
     after drop item on another item the position of items should be change. (Example:- if I select 1st item from list and drag and drop this item to 4th item in list after drop that item position of both item should be changed 1st item on 4th position and 4th item on 1st position)
    I don't know how to do this.Please help me to find the solution.

    Hello Zoltan,
    I do not believe that kind of option is built into the listboxes, but I was able to have similiar functionalities using property nodes. I have included an example program that I put together.
    The big difference is that instead of dragging, you double click on the item you want to transfer. To highlight items as you go down the list, all you need to do is set the value to that list number.
    Hope this helps you out!
    Attachments:
    Temp.vi ‏33 KB

  • Outlook 2013: Imported or copied items from .pst file disappear after a few seconds

    I am migrating from an open source email platform (Axigen) to Outlook/Exchange 2013. The Axigen system uses a connector for Outlook allowing users to use Outlook as a client.
    To move from Outlook 2010 with the Axigen server to Outlook 2013 with Exchange I have exported the entire mailbox from Outlook 2010 to a .pst file which I am then trying to import into Outlook 2013.
    The import process appears to complete successfully and the imported items show up in Outlook 2013 - but only for a second or two. Then they disappear completely, nowhere to be found. This happens with  ontacts, emails and calendar items and the result
    is the same whether I import the entire mailbox or just a folder at a time.
    If I OPEN the .pst file into Outlook 2013 everything in it looks perfectly OK, I can view items with no problems, all folders are there with their correct content. Now if I try to move or copy
    items from the opened .pst file into the Outlook 2013 mailbox, I get the exact same symptoms as when importing. Items show for a couple of seconds and then disappear. If I copy or move a
    folder, the folder remains in the Outlook 2013 folder tree but the items in it disappear.
    Why would items be perfectly visible and readable from an opened .pst file but disappear when they are copied into the new 2013 mailbox?
    They are not visible in OWA either, btw, so this is not just Outlook not displaying them, they are really gone. Checking the folder size in Outlook shows an empty folder (size 0, 0 messages). I have tried the /cleanviews switch when starting Outlook.
    This has me completely stumped. Any ideas?
    Thanks in advance!

    More strangeness:
    I set up an Android phone to sync with this account just now. I imported my contacts list from the phone into the Exchange account. After sync, all the contacts are perfectly visible on the phone, but NOT in Outlook 2013 or in OWA...
    So maybe it is some sort of display filter thing after all? 
    That's unbelieveable that message is visiable in Android phone through Exchange ActiveSync but cannot be viewd in OWA...
    For the database session, we may enable
    Exchange Mailbox Audit logging(http://technet.microsoft.com/en-us/library/ff461937(v=exchg.150).aspx) to check if the message is indeed upload into DB from Outlook.
    For the client level, please enable Outlook logging to log what happens inside outlook to aid in your troubleshooting.
    We can enable Outlook logging in Outlook 2013 under File > Options > Advanced > "Other" section
    Log files are created as .etl files and stored in %userprofile%\Local Settings\Temp.  A new log file is created each time Outlook starts.
    Cheers,
    Tony Chen
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please contact
    [email protected].
    Okay, I have enabled Outlook logging. However I cannot find any way to read those .etl files.
    I also enabled audit logging in Exchange but as I understand it that will not log operations performed by the mailbox owner, only non-owner access. 
    I think I am close to giving up on this. I can't believe an enterprise email platform will simply delete messages copied into a mailbox without any error message whatsoever, and no way for an admin to track what is happening.
    It is definitely happening when syncing with Exchange, so there must be something in these items (and
    remember this happens not only to email messages, but also to Contacts) that makes the Exchange server decide these messages should be discarded witout warning.
    One other thing: Folders copied from the .pst are visible on Outlook (although their contents are deleted) but not on ActiveSync clients. If I create a new folder in the mailbox, it syncs as it should.

  • Deleted items from Ipod Nano to make room for new. Emptied trash. Still getting error message when I try to copy items from ITunes to Ipod. What should I do now?

    Deleted items from Ipod Nano to make room for new. Emptied trash. Still getting error message when I try to copy items from ITunes to Ipod. What should I do now?

    If you delete songs (and other items) from the main iTunes library, yes, you need to empty the Trash because iTunes puts the song files into the Trash.  When deleting items from an iPod, the items are not being deleted from the main iTunes library, so nothing should end up in the Trash.
    Hopefully, you are not deleting items from your main iTunes library, just to sync those deletions from the iPod.  If you are, there is a better way.  You can post back if you want more info...

  • Using "PARAMETER.param_name  as a "Copy item from  value" reference

    I a, using forms 9i and I am having a problem using a Parameter as a reference item. The parameter item is there and I am spelling it correctly, i have even cut and pasted the parameter name into the Copy item value. No matter what I do I get the same result.
    FRM-30047: Cannot resolve item reference PARAMETER.PROJECT_UID.
    Item: PROJECT_UID
    Block: GRANT_SUMMARY
    Form: GRANTS
    FRM-30085: Unable to adjust form for output.
    I have even added a colon to the word PARAMETER but this too fails.
    Suggestions please

    You have to assign it programatically as 'Copy item from Value' is mainly there to keep the master detail relationships. It actually expects a block item rather than a parameter.
    Antony.

  • How can i remove items from list that have been deleted when i click on them it keeps showing empty

    how can i remove items from the list that have been deleted when i click on them it keeps showing folder empty

    Actually, Reader SHOULD keep showing documents that no longer exist, I disagree. It's no big deal, and people will quickly realise why they can't open the file. They open more files, the old ones move off.
    The REASON why it should not check is that checking whether a file exists can take a long time when things aren't good. For instance if a file server goes down, or a memory card is unplugged. That in turn would mean delays opening the File menu, and I've seen some software that can sit there for several minutes. That would really give people something of which to complain...

  • Selecting and copying words from list to textfield

    I am trying to copy words from a list into a text field. I want to be able to select one word at a time, from the list, and have them create a sentence in the text field ie: you build up the sentence one word at a time. I have tried to code this (See code below) but you have to select all the words in one go and then copy them, you can't copy them over individually. Also the words rearrange themselves so that they are in the same order they were in, in the list. Any help would be most appreciated.
    Thanks in advance
    Jes
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    //<applet code="MyList.class" width=400 height=300></applet>
    public class MyList extends Applet implements ActionListener {     
    private List wordList, copyList;
    private Button copy;     
    private TextField answer;     
    public MyList(){     
    public void init()     {     
    wordList = new List (5, true);
    copy = new Button ("Copy >>>");
    answer = new TextField (30);     
    copy.addActionListener(this);
    wordList.addItem("say");
    wordList.addItem("Oranges");     
    wordList.addItem("St.");     
    wordList.addItem("Lemons");     
    wordList.addItem("bells");     
    wordList.addItem("and");     
    wordList.addItem("Clements");     
    wordList.addItem("the");     
    wordList.addItem("of");
    add (wordList);          
    add (copy);          
    add (answer);     
    public void actionPerformed (ActionEvent e)     {
    String[] words = wordList.getSelectedItems();
    StringBuffer sentence = new StringBuffer();     
    for (int ii = 0; ii < words.length; ii++) {     
    sentence.append(words[ii]+" ");}          
    answer.setText(sentence.toString());     

    I'm a tad confused with your question. Do you NOT want multiple selection, or do you?

  • Create document item from list, then no lookups

    SharePoint 2013: I have a content type set up in a document library with a default document template attached (in this case an excel workbook file).
    In SPD 2013 (using a 2010 workflow), I can use the "Create Item in List" function in SPD from an adjacent list on the same site collection to create a record in the document library, and set the content type such that when the workflow is done there
    is indeed a new document waiting for me in the doc library, utilizing the expected template file.
    The issue:
    The output of the "Create Item in List" function is the ID of the item created.  Using the Create variable, I believe I should be able to immediately lookup attributes of the newly created Document item, such as the last modified date and URLs.
     I'm doing the lookups within the output of a Log (to workflow history) function.  However, certain fields always come back blank.  Performing the same lookup, using a known Document item ID (created in another w/f session) is successful.  It
    would be nice to email out a URL of the file I just created from the same workflow.
    I've tried having the W/F wait up to 5 minutes, but it appears that certain attributes cannot ever be retrieved in the same workflow, while others can indeed be retrieved (GUID of the new doc is successful, for instance).
    I've read some online debate related to this, but I can't find anyone having the exact same issue as me, nor explain why it's happening.  It seems like it should be so straightforward.  Any ideas?  Thanks!

    Hi,
    According to your description, my understanding is that you create a document library item using “Create item in list ” action and when you log some certain attributes of the item to workflow history list, then
    it has no value.
    I try to reproduce this issue with your steps and it works as expected in my environment.
    For a better troubleshooting, I suggest you do as the followings:
    1. Check if the certain new created item field has value in the list which always return blank.
    2. I suggest you can create a new simple workflow to log the field data for new created item to workflow history list to test if it works.
    3. If the issue still exists, I suggest you can track the workflow using Fiddler. You can see detailed web request for the workflow, it will be easier to find the cause of this issue.
    Here is a detailed article for your reference:
    http://msdn.microsoft.com/en-us/library/office/dn508412(v=office.15).aspx
    Best Regards
    Jerry Guo
    TechNet Community Support

  • JList run time errors when removing items from list

    Hi there
    I am having trouble removing items from a JList. For a While it was working fine and now it outputs runtime errors everytime samething gets removed from the lsit
    Here is the code
    //declare
    public class Consumertab1gui extends JPanel implements ActionListener
         public static JList conList = null;
         private static DefaultListModel model = null;
    // Create a list with some items
    model = new DefaultListModel();
    conList = new JList(model);
    //set the size of cells in the list with the length of the string
    conList.setPrototypeCellValue("Lenght 1234567890");
    conList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    conList.addListSelectionListener(new ValueReporter());
    //set a scroll onto the list
    JScrollPane conScroll = new JScrollPane(conList);
    add(conScroll,c);
    //when the button gets pressed to drop the selected item the following code is called
    private void dropConsumer()
    int selItem=0;
    componentsV.comVRemove(conList.getSelectedValue().toString());
    selItem=conList.getSelectedIndex();
    System.out.println("No:"+(model.getSize()-1));
    System.out.println("S:"+selItem);
    remConList(selItem);
    dropCon.setEnabled(false);
    //which in turns calls this
    public void remConList(int pos)
         model.remove(pos);
    when the model.remove(pos) code is executed the following runtime errors are given:
    java.lang.NullPointerException
    at Consumertab1gui$ValueReporter.valueChanged(Consumertab1gui.java:197)
    at javax.swing.JList.fireSelectionValueChanged(JList.java:1321)
    at javax.swing.JList$ListSelectionHandler.valueChanged(JList.java:1335)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:187)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:214)
    at javax.swing.DefaultListSelectionModel.removeIndexInterval(DefaultListSelectionModel.java:546)
    at javax.swing.plaf.basic.BasicListUI$ListDataHandler.intervalRemoved(BasicListUI.java:1561)
    at javax.swing.AbstractListModel.fireIntervalRemoved(AbstractListModel.java:160)
    at javax.swing.DefaultListModel.remove(DefaultListModel.java:478)
    at Consumertab1gui.remConList(Consumertab1gui.java:38)
    at Consumertab1gui.dropConsumer(Consumertab1gui.java:58)
    at Consumertab1gui.actionPerformed(Consumertab1gui.java:46)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5100)
    at java.awt.Component.processEvent(Component.java:4897)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3615)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    at java.awt.Container.dispatchEventImpl(Container.java:1613)
    at java.awt.Window.dispatchEventImpl(Window.java:1606)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    can anyone spot any mistakes in the code or suggest possible resons as to why these run time errors occur?
    Thanks
    alexis

    java.lang.NullPointerException
    at Consumertab1gui$ValueReporter.valueChanged(Consumertab1gui.java:197)The NullPointerException occurs at line 197, in the valueChanged method of your ValueReporter inner class. I have looked through your post several times but I don't see where you posted that method. Anyway, that is where you should look.
    PC&#178;

  • Copy item from Quotation to sales Order

    Hello,
    How can I copy all the line items from quotation to sales order including the price, Quantity & the Sales Texts?
    Thanks
    AK

    Hi
    Maintain copy control from sales document to sales document using t-code VTAA. Select your target & source sales document type from the list & double click on the same. There you can define the copy control.
    For Text control you can use the T Code VOTXN & create your own text controls.
    I hope this will be helpful.
    Thanks & Regards,
    Bidhu

  • Error when copying items from one table to another

    I am trying to copy data from 2 archive tables within an
    Access database to their twin production tables. The first table
    copies perfectly with the code:
    <CFQUERY NAME="moveArchAttach" datasource="faaco2">
    INSERT INTO tbl_Attachment ( PostID, Attachment, AttachNote,
    AttachName )
    SELECT tbl_Attachment_Archived.PostID,
    tbl_Attachment_Archived.Attachment,
    tbl_Attachment_Archived.AttachNote,
    tbl_Attachment_Archived.AttachName
    FROM tbl_Attachment_Archived
    </CFQUERY>
    However, when trying to use similar code on the other table:
    <CFQUERY NAME="moveArchPost" datasource="faaco2">
    INSERT INTO tbl_Posting ( Title, FirstName, LastName,
    PhoneNumber, RoutingSymbol, Email, IniDate, ComDate, SOLNBR,
    PhaseCode, ProcCode, Posting, Password, RegionCode )
    SELECT tbl_Posting_Archived.Title,
    tbl_Posting_Archived.FirstName, tbl_Posting_Archived.LastName,
    tbl_Posting_Archived.PhoneNumber,
    tbl_Posting_Archived.RoutingSymbol, tbl_Posting.Email,
    tbl_Posting.IniDate, tbl_Posting.ComDate, tbl_Posting.SOLNBR,
    tbl_Posting.PhaseCode, tbl_Posting.ProcCode, tbl_Posting.Posting,
    tbl_Posting.Password, tbl_Posting.RegionCode
    FROM tbl_Posting_Archived
    </CFQUERY>
    I receive the error:
    [Microsoft][ODBC Microsoft Access Driver] Too few parameters.
    Expected 9.
    Any help would be greatly appreciated, I am at a loss and
    I've tried everything. Thank you.

    I realized my error immediately after posting this topic and
    subsequently have resolved this error. On 9 of the values, I have
    listed the wrong table in the SELECT statement. This is why one
    needs to take breaks instead of staring at a screen forever :).
    Thank you anyway!

  • Problems when copying item from a page to another one

    I am copying a value of an item, from a page to another one in branch, and it cuts the value to me in ' : '
    ej: item a = 08:00 Hs
    item b = 08
    thanks
    Juan Pablo

    I had to deal with the same thing and I know at least two solutions - one is "dirty" and the other one is a "clean":
    1. dirty - replace ':' (colon) with ';' (semicolon) and pass that value using URL. On the page, where your item(s) is, create a computation using REPLACE(P1_ITEM, ';', ':') on load and before header.
    2. clean - as Scott says and it works in many cases - pass only a primary key and a request to your target page and create there a procedure to fetch the values you need and populate the items
    If you use the documentation and search on keywords "COMPUTATION" and "REQUEST", you will find a lot of usefull information.
    Denes Kubicek

  • Copy items to list of folder

    Hi all,
    Is it possible to run an automator action that first find items using the "Find Finder Items" function and that copy the results to a list of folder which I again find using "Find Finder Items"?
    Thanks,
    Ziv

    There isn't an action that steps through the items in a list and the various copy actions only allow a single destination. If you have to find the destination folders, then possibly a Run Shell Script or Run AppleScript action could be used (or just do the whole thing in AppleScript). If you already know the destination folders, you can place the files to copy in a variable and use separate Copy Finder Items actions for each destination folder.

  • Removing items from List Component

    Below is a function set that's used to get info from an XML
    source(s) and populate a List Component (videoList). Works great.
    The second function loads data from a separate XML source and
    populates the SAME List Component. When the second function is
    called it loads the data in addition to the existing data into the
    List Component. I want it to REPLACE the data. How would I
    accomplish this?
    public function getXMLdata(event:Event):void {
    var campXML:XML = new XML(xmlLoader.data);
    var vid:XML;
    for each(vid in campXML.vid) {
    videoList.addItem({label:vid.attribute("desc").toXMLString(),
    data:vid.attribute("src").toXMLString(),
    text:vid.attribute("text").toXMLString()});;
    videoList.selectedIndex = 0;
    videoList.addEventListener(Event.CHANGE, playnewvid);
    FLVPlayer.source = videoList.selectedItem.data;
    FLVPlayer.pause();
    clipText.text = videoList.selectedItem.text;
    public function getXMLdata2(event:Event):void {
    var nflXML:XML = new XML(xmlLoader2.data);
    var vid:XML;
    for each(vid in nflXML.vid) {
    videoList.addItem({label:vid.attribute("desc").toXMLString(),
    data:vid.attribute("src").toXMLString(),
    text:vid.attribute("text").toXMLString()});;
    videoList.selectedIndex = 0;
    videoList.addEventListener(Event.CHANGE, playnewvid);
    FLVPlayer.source = videoList.selectedItem.data;
    FLVPlayer.pause();
    clipText.text = videoList.selectedItem.text;
    }

    That took 2 minutes! Works like a charm Manno. Thank you for
    your response.
    For those curious, here's the solution:
    public function getXMLdata(event:MouseEvent):void {
    videoList.removeAll();
    var campXML:XML = new XML(xmlLoader.data);
    var vid:XML;
    for each(vid in campXML.vid) {
    videoList.addItem({label:vid.attribute("desc").toXMLString(),
    data:vid.attribute("src").toXMLString(),
    text:vid.attribute("text").toXMLString()});;
    videoList.selectedIndex = 0;
    videoList.addEventListener(Event.CHANGE, playnewvid);
    FLVPlayer.source = videoList.selectedItem.data;
    FLVPlayer.pause();
    clipText.text = videoList.selectedItem.text;
    public function getXMLdata2(event:MouseEvent):void {
    videoList.removeAll();
    var nflXML:XML = new XML(xmlLoader2.data);
    var vid:XML;
    for each(vid in nflXML.vid) {
    videoList.addItem({label:vid.attribute("desc").toXMLString(),
    data:vid.attribute("src").toXMLString(),
    text:vid.attribute("text").toXMLString()});;
    videoList.selectedIndex = 0;
    videoList.addEventListener(Event.CHANGE, playnewvid);
    FLVPlayer.source = videoList.selectedItem.data;
    FLVPlayer.pause();
    clipText.text = videoList.selectedItem.text;
    }

  • Removing items from list

    hi all,
    i am having a list in which there are 4 elements in it.
    i need to remove the first and third elements in the list and make an iterator out of the modofied list
    i can create the iterator but can any one help me in removing specific elements in the list
    regards and thanks in advance

    i have seen this .there is no method to removeitems
    at specific locations
    sigh
    What is
    [url=http://java.sun.com/j2se/1.5.0/docs/api/java/util
    /List.html#remove(int)]this then ?This forum needs an introductory list of tips and
    tricks. Very high on
    that list should be a link to the JavaDoc API
    documentation or a link to
    the download site where everyone could download the
    darn thing.
    Now the question remains: how to make everybody
    read those API docs?
    kind regards,
    Jos
    I sadly suspect there needs to be a tutorial on HOW to read the API docs. :(
    PS For future question on deletions just ask the Sun admins as they would be the experts.

Maybe you are looking for

  • How do I activate my icloud account from my iPad

    How do I activate my icloud account from my iPad

  • Error in PLSQL Procedure...

    Hi Guys, I have the following functions inside a package... I was trying to create directories dynamically in the runtime in side a plsql... FUNCTION Get_Site_Dir_Name (    site_     IN VARCHAR2,    dir_type_ IN VARCHAR2 ) RETURN VARCHAR2 IS BEGIN   

  • Idoc using inbound process

    Hi, my issue is regarding the Idoc using inbound process using the FM BAPI_IDOC_DISTRIBUTE_LIST1. here the user wants the dhmt plant tobe refer instead of mirror plant. can anybody help me regarding this or any doc regarding iDOCS inbound.

  • Find the PO number in SAP

    Hi, I needed to know how to find the PO number in SAP by the source of (Vessel code, voyage and Port code we upload in configuration), is there is any way to found PO numbers for the particular vessel and voyage?Is there is any transaction code to fi

  • Disable resource account via Workflow

    Hello I created a transition in the Update User workflow to disable a resource account if a field is indicated in the admin tabbed user form. This activity works but all resource accounts (email, AD) are being disabled. Only email needs to be disable