Newbie...need help with a CAML repeating table to push updates to Sharepoint List - InfoPath Dev
in

InfoPath Dev

Newbie...need help with a CAML repeating table to push updates to Sharepoint List

Last post 02-21-2011 12:32 PM by Anderson10. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-21-2011 12:18 PM

    Newbie...need help with a CAML repeating table to push updates to Sharepoint List

    See below..

     

  • 02-21-2011 12:32 PM In reply to

    Re: Newbie...need help with a CAML repeating table to push updates to Sharepoint List

    Sorry that was bad.

    I will retype:

    Hi, newbie, and need help to complete an infopath form (07) which updates a sharepoint list called "Sharepoint_List_Items")

    Basically i have a list such as follows (this is being pulled from list Sharepoint_List_Items). It is worth noting that the ID is not an inputted field representing a code of the item/person, but actually relates to the actual unique ID assigned by the Sharepoint list, so reference to it in CAML would result in update to the table.

    ID      Person      Item No      Status

    1       B              Pencil        Blank (needs to be populated by input into the form)

    2       A              Pen           Blank (needs to be populated by input into the form)

    3       B              Pen           Blank (needs to be populated by input into the form)

    4       C              Ruler         Blank (needs to be populated by input into the form)

    5       A              Eraser       Blank (needs to be populated by input into the form)

    6       A              Case         Blank (needs to be populated by input into the form)

    My target audience for this form will only see the items they need, this is done using conditional formatting on the name they input. The reason for this is person A only needs a pencil, pen and eraser whilst person c only needs a ruler. So for example person A will key in "A" into a field "Person_Name", which his view then filters to a table like the below:

    ID        Person     Item Name

    2         A             Pen

    5        A             Eraser

    6        A             Case

    Each person is then aksed to confirm if they have received the items, with checkbox options against the following these are independent checkbox fields, not tied to the Sharepoint_List_Items data source:

    Received All [checkbox]

    Received None [checkbox]

    (I also have "Received Some" as check, but i don't want to worry about that now)

    I have a rule which then populates a CAML repeating table that i have set up (Name, Field, etc). So when person A selects checkbox "Received All", I have a rule, which checks, against Sharepoint_List_Item's all the item IDs which has person A against it. This compares to Person_Name (inputted by the user on IP form). The results of the rule and data filters then writes to a CAML repeating table. Example, if person A checks "Received All", my rule should write to the CAML repeating table:

    Name Field

    ID          2

    Status    Received

    ID          5

    Status    Received

    ID          6    

    Status    Received

    This is intended to then update Sharepoint_List_Items record IDs 2, 5 and 6 with "Received" in the status column. I would expect that my rule would update records 2, 5 and 6 with the status is all was smooth. So once person A enters his name, marks his checkbox appropriately and clicks submit, my lookup rule executes and writes to CAML table, then web service calls out the CAML template and through a submit data connection push to Sharepoint_List_Items to populate Status column.

    My problem is that the CAML repeating table only looks up the first value which is allocated to person A, ie, ID 2. The CAML table looks like:

    Name     Field

    ID           2

    Status    Received

    Items 5 and 6 do not appear on the CAML repeating table so when person A submits, only record ID 2 gets updated, not 2, 5 and 6 which should be right. In the same way, if person B completed the form and checked "Received All", only ID 1 would be written to CAML, not both 1 and 3. My rule, using filtered data functionality is as below, for the lookup that writes to the CAML table:

    Action: fx set a fields value

    Field: Field [@Name="ID"]

    Value: @ID[@Person = Person_Name]

    The xpath for value is as follows:

    xdXDocument:GetDOM("Sharepoint_List_Items")/dfs:myFields/dfs:dataFields/dfs: Sharepoint_List_Items/@ID[../@Person = xdXDocument:get-DOM()/my:myFields/my:Person_Name]

    CAML template:

     <?xml version="1.0" encoding="UTF-8"?>
    <Batch OnError="Continue">
        <Method ID="1" Cmd="Update">
            <Field Name='ID'></Field>
            <Field Name="Status"></Field>
        </Method>
    </Batch>

     Not sure what i'm doign wrong, basically, how do i get my CAML repeating table to populate items 5 and 6 to then publish into Sharepoint_List_Items, rather than just looking up and retriving the first item it finds ie, item 2? I have everything else right such as being able to write "Received" or "Not Received" against individual IDs, and pushing succesfully to update the status in Sharepoint_List_Items but its just that the first line of lookup against Sharepoint_List_Items is being returned, and nothing else which means only the first lookup value will get updated. I have read that it may be related to "current()" command in the filter lookup above, but tried it and didn't work, though maybe i could have done it wrongly.

    Would appreciate help very much, this forum has gotten me very far and i'm close but this is stopping me! I should also highlight that i'm not in a position to download or purchase other software so QRules and CAML Query Writer are out of the question.

    Thanks.
     

     

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.