Issue with Updating Secondary Datasource before Submit to Sharepoint - InfoPath Dev
in

InfoPath Dev

Issue with Updating Secondary Datasource before Submit to Sharepoint

Last post 02-11-2014 11:44 PM by Kasper Smith-Jensen. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-09-2014 06:20 AM

    Issue with Updating Secondary Datasource before Submit to Sharepoint

    Hi all, I have a problem I can't quite figure out a good solution too. I have made a form where people can update a selection of fields. These values get sent to a Document Library in Sharepoint. When you load the form the fields automatically gets populated with values from Sharepoint based on a match(a dropdown list in the form where the value is sent to Sharepoint as well). My problem is that there could be more than 1 person updating the same item at the same time. So for instance Person A is updating some values and sends the info to Sharepoint. Person B has during this time also opened up the form and is updating some other values, the fields Person A has updated is in Person Bs form already loaded with the earlier values. So when Person B sends to Sharepoint, the changes Person A has made will get erased. Usually I would fix this issue with an update of the data connection just before submitting to Sharepoint, to be sure all values gets updated. But since the values Person B was updating are also being updated by the same data connection, the changes he made would get erased with the update of the data connection. The only "solution" I can think of is to make several Data Connections where each connection updates a selection of the form. And then before Submit all connections but the one where the Person has done some changes will get updated with fresh values from Sharepoint. This I think would solve the problem as long as I don't have 2 people doing an update to the same selection of the form at the same time. I hope there is a better way though. Does it make sense or do I need to clarify anything Hope anyone has a solution to this. I guess I'm not the first person experiencing this. Kind Regards Kasper Smith-Jensen
  • 02-11-2014 11:30 PM In reply to

    • RaYvA
    • Top 100 Contributor
    • Joined on 05-09-2013
    • Melbourne, Australia
    • Posts 86

    Re: Issue with Updating Secondary Datasource before Submit to Sharepoint

    Hi Kasper,

    So the issue is concurrency of the update?

    Person 1 opens form and see's data
    Person 1 changes data
    Person 2 opens form and see's original data
    Person 1 saves data
    Person 2 changes data
    Person 2 overwrites Person 1's updated data

    I would have to question why you data is architected to allow this to happen, assuming that Person 1 and Person 2 need to change different data that is, but aside from that, you are on the correct track.... Prior to every submit, you would have secondary data connection that queried the original data souce, then determins if there are any changes to the underlying data, copy those changes into the current form and then submit the current form.  So the workflow steps become:

    Person 1 opens form and see's data
    Person 1 changes data
    Person 2 opens form and see's original data
    Person 1 queries secondary data source to original data
    Person 1 determines is there are any updates since retrieving the original data and makes appropriate modifications
    Person 1 saves data
    Person 2 changes data
    Person 2 queries secondary data source to original data
    Person 2 determines is there are any updates since retrieving the original data and makes appropriate modifications
    Person 2 saves data

    Hopw this helps

    Cheers

  • 02-11-2014 11:44 PM In reply to

    Re: Issue with Updating Secondary Datasource before Submit to Sharepoint

    Hi Ravya, Yes that was exactly the problem. The reason for it to be architected this way was basically that I needed inputs from different departments regarding the same KPI. So more than one department could make an update at the same time, but would only update the value for their own department. And since the KPI was the "identificator" when I send the form to Sharepoint I could get into the trouble described. I solved the problem by making a few different secondary data sources(one for each department) that all looked into the Sharepoint Library. Each of these secondary data sources would then be targeted towards "their own" fields in Infopath. And on submit I would update all the datasources besides the one where the update had just been made. Kind Regards Kasper
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.