I will try to explain:
I have an InfoPath form that contain those fields:
IDnumber,FirstName,LastName,Address, and other fields.
My form been bublished to a SharePoint Library (forms folder) and each new form that been fill out is submited to this SharePoint folder (Main Submit). each form that been submited get the file name by this formula:
concat(IDNumber, "_", today())
I can fill out many form to same IDnumber.
I want that in case that I fill out a form the follwing will happen:
1) I start with the IDnumber, if there is alredy file (in the SharePoint Library) that contain this IDnumber, so it will put the firstName, LastName and Address values on their fields (get exist values from exist form). If not, I will fill it regular and submit the form.
That's why I cant use Dropdown list for firstName,LastName and Address!!
2) because my request in 1, I need to write code on the OnAfterChange event of the IDnumber field. In the code I will operate Web service (I will make data connection to this WS) that recive the IDnumber as Parameter an it will search file in the SharePoint Library that contain this IDnumber value, and if find, the Web Service return the valuse of firsname,Lastname and Address and in the form's code (OnAfterChange event) I will fill those values in the form.
I need few things from you for this:
1) Tell me if the way I think to do it is right?
2) If yes, I need Example of how to write the WebService (in c#) that get one paramete (IDnumber) and operate search in the SharePoint Library (forms list) and return the value I need (the values will be culomns of the list).
3) How to connect the form's code (VBscript) to the Data connectin that recive data from the web sercive. How to call the WS from the code?
I hope that is good
Thanks