Hi All
I'm hoping someone can help me with my form functionality. I'm using InfoPath2010 to write information to a SharePoint 2010 list. My list is a list of organisations we deal with and already exisits in SharePoint with some organisations already input - it typically has the following columns:
there area few other columns but they are either text or lookup.
I have placed the infopath form in a webpart on a page in SharePoint. I've figured out how to submit the form when someone has filled out all the appropriate info, this writes a new item in the list, pops up a box saying their entry was successful and refreshes the page with a blank form ready to start again.
I want the user of this form (i.e. people entering new organisations or updating existing information) to be able to check if an entry already exists, if it does then I want them to be able to edit that info and write it to the list or if not, to enter the new organisation and write it to the list.
My methodology so far is:
-
type the name of the organisation
-
click a button to query the existing list
-
return the results to the list input fields if it exists, OR display a text box saying "does not exist - please enter the details in the following fields"
-
on submit it updates the list and refreshes the page to present a new input form
So, I want to display only the title input field and the button to begin, then display the items noted in point 3 above.
What I don't understand is the conditional formatting I need to do with the fields. Logically I think I should be able to label the Title text box, put a rule on the button i.e. when clicked a) query the SP list for the title b) write information to the fields.
I dont know how to write the query for this I am trying to match the Title field on the form to the Title field in the list. I can see the rule action to query a data source,ok, but what is the programming stuff I need to do? I can see how to set a value of a field and can probably work out how to do this for all the extra fields but not sure how to write the conditional stuff for matching the title.
Oh dear, that sounds all very confused!
If anyone can help I'd be really grateful!
thanks
Megan