J
jb
[Newbie to InfoPath; but quite impressed.]
I have spent all day trying to do something so simple; I think I have
finally got there, but I'm surprised no examples etc. etc., have I done it
right?
1. All I want is a simple form which fetches some information from a web
service (e.g. info about the web service itself). No user interaction! Just
they run the form; when it starts up, they see the data.
2. Initially, because I did it wrong by accident, it worked! Ended up with
no "Main Data Source" connection or fields, but a "secondary" one connected
to my WS (I had probably added an extra connection). Had the "auto retrieve
data when form is opened" box checked, bound the fields, worked a treat!
3. Realised I had done it "wrong". Went back and tried to do same for Main
Data Source... stumped! No such box. Absolutely no examples. All use "Run
Query" button, don't want that, and very difficult to discover just what that
does.
4. Edited "OnLoad" event. Eventually figured I needed just:
XDocument.QueryAdapter.Query();
there. (Tried XDocument.DataObjects(...).QueryAdapter; but the Count is 0, I
guess this is *only* for additional/secondary data sources?)
This seems like such a (reasonably) common scenario, I'm surprised it's so
difficult to figure.
* Have I done it right now?
* Should I actually have stuck with the secondary datasource only solution
for what I want?
* To finish off, I ought to have all the data fields read-only. Is the
only/correct way to mark each one individually? Not too bad for, say, text
boxes, but what about checkboxes? I just want the whole form & controls to
be read-only, no red asterisks etc. for "compulsory" fields...
I have a couple other questions about other things, would like to see if
anyone replies to this. TIA...
I have spent all day trying to do something so simple; I think I have
finally got there, but I'm surprised no examples etc. etc., have I done it
right?
1. All I want is a simple form which fetches some information from a web
service (e.g. info about the web service itself). No user interaction! Just
they run the form; when it starts up, they see the data.
2. Initially, because I did it wrong by accident, it worked! Ended up with
no "Main Data Source" connection or fields, but a "secondary" one connected
to my WS (I had probably added an extra connection). Had the "auto retrieve
data when form is opened" box checked, bound the fields, worked a treat!
3. Realised I had done it "wrong". Went back and tried to do same for Main
Data Source... stumped! No such box. Absolutely no examples. All use "Run
Query" button, don't want that, and very difficult to discover just what that
does.
4. Edited "OnLoad" event. Eventually figured I needed just:
XDocument.QueryAdapter.Query();
there. (Tried XDocument.DataObjects(...).QueryAdapter; but the Count is 0, I
guess this is *only* for additional/secondary data sources?)
This seems like such a (reasonably) common scenario, I'm surprised it's so
difficult to figure.
* Have I done it right now?
* Should I actually have stuck with the secondary datasource only solution
for what I want?
* To finish off, I ought to have all the data fields read-only. Is the
only/correct way to mark each one individually? Not too bad for, say, text
boxes, but what about checkboxes? I just want the whole form & controls to
be read-only, no red asterisks etc. for "compulsory" fields...
I have a couple other questions about other things, would like to see if
anyone replies to this. TIA...