Think i'm close but cant get over the finish line (qrules) - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Think i'm close but cant get over the finish line (qrules)

Last post 03-23-2014 10:13 PM by Ruskin11. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 10-03-2013 07:25 AM

    Think i'm close but cant get over the finish line (qrules)

    Ok i have a form that users open and enter data. On submit the data is submitted to a list CLASSDATA with an ID called CLASSID and the form saved in a form library with a unqiue filename. I need to make the data in the form updatedable. So what i have done is when the user opens the form, i want them to click submit and this updates the data in the list, not create a new line of data in the list. At the moment IT IS just creating a new line of data in the list. In my list i have the unique ID called CLASSID and all i want to do when updating the data is say update the data where CLASSID = (ID stored in the form). Do i have 2 mappings for this form, one for when the data is first submitted and one for when it is an update? Getting really frustrated!
  • 10-03-2013 07:34 AM In reply to

    Re: Think i'm close but cant get over the finish line (qrules)

    If you are re-opening the original form then the CLASSID should be the ID of the list item. Which would update the same ID in the list. If you are opening a new form then your would have to query the list using a date or something to get the ID you want to update. Something like this ID[Title = current()/../your field in form] Little more info. You can have a date picker. That has an action that sets the query field in the list to grab items for that date. By querying the list. Then you can have the next action set a true/false Boolean to start the next set of rules to grab the ID using the info above then mark its back to false.
    Filed under: ,
  • 10-03-2013 07:49 AM In reply to

    Re: Think i'm close but cant get over the finish line (qrules)

    The ClassID is generated from where the user opens the form. You see the user opens it from an entry list, it is a list of classes and each one has a unique ID (ClassID). When they open the form the ClassID is already prepopulated.

    When they submit their data, the data is sent to a new list CLASSDATA and a column called CLASSID stores the unique ID. I am not using the unique SP LIST ID in class data. Think of it similar to a relational database, i am using the CLASSID thoughout the site.

    So when the user opens the form again and submits i want it to

    UPDATE WHERE CLASSID = CLASSID

    I'm just not sure how i do this with the mapping file.................
  • 10-03-2013 07:59 AM In reply to

    Re: Think i'm close but cant get over the finish line (qrules)

    Here is a simplified version of the mapping file. (attached)

    All i want it to do is update the data where my:ID = CLASSID

    I think i am close but just can't crack it, thanks for your help :-)
  • 10-03-2013 08:01 AM In reply to

    Re: Think i'm close but cant get over the finish line (qrules)

    Did you trying mapping the ID to the other list. In mapping tool CLASSID is mapped to the CLASSID in the other list. That way the data written is the same ID. Button can have a rule CLASSID = CLASSID.
  • 10-03-2013 08:05 AM In reply to

    Re: Think i'm close but cant get over the finish line (qrules)

    Yes the classID is stored in the ClassList just fine.

    I just now need to update the ClassList item where CLASSID = CLASSID, how do i do this in my mapping file that submits the data to the list?
  • 10-03-2013 08:28 AM In reply to

    Re: Think i'm close but cant get over the finish line (qrules)

     So - here's the thing with qRules. If you have an ID field that you have indicated will have the SharePoint List Item ID, qRules will try to update that item. That means you can use rules to set the ID field to the correct ID for the item you want to update. Let's say in your SharePoint List  you want to update item 10 and in your form you have a field called my:ShPListID where you are storing the list item ID. Set my:ShPListID to 10 for the item you wish to use for the update and you are done.

    Looking at your mapping - I see you don't have anything mapped as an ID column. What is the syntax of the command you are using? When do you want to update? That is, do you save the filled out XML and want the list item to update the next time the XML is updated?

    Hilary Stoupa

  • 10-03-2013 12:20 PM In reply to

    Re: Think i'm close but cant get over the finish line (qrules)

    aha, i have over complicated things! All i have done is add a field in my form called uIQ, mapped this in my mapping file to be a ID (SPID) and hey presto, it works, inserts, updates etc :-)

    One other problem that might be common...........................

    I have a list that shows a list of classes. One of the columns is a calculated column and it is a link to "add data" or "update data". If the user is using the form for the first time it opens a blank form and the user fills it out and submits the form/data, part of the submission is the form updates a column in the classes list, this is called "data entered" the form sets the value to "Yes". All rows of data where data hasn't been completed the "data entered" column is set to "".

    The calculation in the column looks at "data entered" and if it is a "yes" it sets the link to the form library and the filename of the form where the data has been added. If the value is "" it links to the form and passes in an ID (the ID of the Class)

    ** My code was stripped out i have added it as a text file

    Is this a good way to do this, is there an easier way?

    I also have another issue where the ID value is not getting appended to the url, is there a max length in a calculated column?

    Thanks for your time.
  • 10-03-2013 06:08 PM In reply to

    Re: Think i'm close but cant get over the finish line (qrules)

    I don't really understand the question, I'm afraid. Is this column in your list? The same one you are submitting to? If so, perhaps instead of your formula you could have a hyperlink column and submit from your form to that (but I guess that doesn't handle for the situation where there isn't a form for the list item - unless you had a default value - not sure offhand if hyperlink columns can have defaults.)

    Hilary Stoupa

  • 03-23-2014 10:13 PM In reply to

    Re: Think i'm close but cant get over the finish line (qrules)

    I think I have a similar issue, that I am trying to fix.

    I have managed to have the list item that I want to edit as a hidden attribute in my form, so that when the user accesses the form next and any data that they enter is updated to the form.

    The problem that I can't overcome, which i think is the same problem you are having, is that I don't know how to reference to the item in my list based on the ID in the form.

    I am using the following commands to add data to the list

     

    batch.SelectSingleNode(

    "/Batch/Method/Field[@Name='Seq2ActivityClosedDate']", NamespaceManager).SetValue(seq2ActivityClosedDate);

    but all itll do is add a new entry into the list, where as I want to add this data to the existing list/xml document.

    Were you able to achieve this?

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