Custom Submit Code in C# in IP 2k7 Object Model

J

Josiah Smith

I am attempting to learn what it will take to transform our 2500+ lines of
JScript in IP 2k3 to C# in IP 2k7. I've been able to stumble my way around
with a few basic things, but am having trouble with custom submit code, and
will probably have trouble with an equivalent for open.

For the custom submit code, I tried the following,
<code>
DataConnections("SaveAsTestC# Submit").Execute();
</code>
but got an error of
'Microsoft.Office.InfoPath.XmlFormHostItem.DataConnections' is a 'property'
but is used like a 'method'

I haven't even tried to tackle the new object model equivalent for
NewFromSolution, let alone Application.XDocument.Open()...

I'm trying to learn the new IP 2k7 MOM, but obviously, over the past year,
there's been a lot less community experience with IP 2k7 than there is for IP
2k3 to draw from. It would even help if I could get the completed, or more
current help files for IP 2k7.
 
S

S.Y.M. Wong-A-Ton

Try

DataConnections["SaveAsTestC# Submit"].Execute();

Notice the square brackets I used instead of the round ones you used?
 
J

Josiah Smith

Thank you very much!!

Do you know where I could get more step-by-step info on switching to the new
object model?

Josiah Smith

S.Y.M. Wong-A-Ton said:
Try

DataConnections["SaveAsTestC# Submit"].Execute();

Notice the square brackets I used instead of the round ones you used?
---
S.Y.M. Wong-A-Ton


Josiah Smith said:
I am attempting to learn what it will take to transform our 2500+ lines of
JScript in IP 2k3 to C# in IP 2k7. I've been able to stumble my way around
with a few basic things, but am having trouble with custom submit code, and
will probably have trouble with an equivalent for open.

For the custom submit code, I tried the following,
<code>
DataConnections("SaveAsTestC# Submit").Execute();
</code>
but got an error of
'Microsoft.Office.InfoPath.XmlFormHostItem.DataConnections' is a 'property'
but is used like a 'method'

I haven't even tried to tackle the new object model equivalent for
NewFromSolution, let alone Application.XDocument.Open()...

I'm trying to learn the new IP 2k7 MOM, but obviously, over the past year,
there's been a lot less community experience with IP 2k7 than there is for IP
2k3 to draw from. It would even help if I could get the completed, or more
current help files for IP 2k7.
 
S

S.Y.M. Wong-A-Ton

There isn't much info out there yet. Some useful tips are given on the
InfoPath Team blog (http://blogs.msdn.com/infopath/). I just use the InfoPath
2007 Managed Object Model Poster
(http://www.microsoft.com/downloads/...45-9D27-4D1F-ACD1-9B950637D64E&displaylang=en)
or Object Browser in Visual Studio to find what I need.

If you get stuck again, just post your question and perhaps someone might be
able to help!
---
S.Y.M. Wong-A-Ton


Josiah Smith said:
Thank you very much!!

Do you know where I could get more step-by-step info on switching to the new
object model?

Josiah Smith

S.Y.M. Wong-A-Ton said:
Try

DataConnections["SaveAsTestC# Submit"].Execute();

Notice the square brackets I used instead of the round ones you used?
---
S.Y.M. Wong-A-Ton


Josiah Smith said:
I am attempting to learn what it will take to transform our 2500+ lines of
JScript in IP 2k3 to C# in IP 2k7. I've been able to stumble my way around
with a few basic things, but am having trouble with custom submit code, and
will probably have trouble with an equivalent for open.

For the custom submit code, I tried the following,
<code>
DataConnections("SaveAsTestC# Submit").Execute();
</code>
but got an error of
'Microsoft.Office.InfoPath.XmlFormHostItem.DataConnections' is a 'property'
but is used like a 'method'

I haven't even tried to tackle the new object model equivalent for
NewFromSolution, let alone Application.XDocument.Open()...

I'm trying to learn the new IP 2k7 MOM, but obviously, over the past year,
there's been a lot less community experience with IP 2k7 than there is for IP
2k3 to draw from. It would even help if I could get the completed, or more
current help files for IP 2k7.
 
J

Josiah Smith

O.K., now that I am on the network here at work, I tried that
DataConnections[Submit Connection].execute(), and if you use a comma in the
filename, you still get an underscore when submitted to sharepoint. I got
around this with custom code using JScript IP 2k3 Object Model in IP 2k7, but
I will have to hack at this using C# now.

Thanks for the help, but that bug is still there.

Josiah Smith

S.Y.M. Wong-A-Ton said:
There isn't much info out there yet. Some useful tips are given on the
InfoPath Team blog (http://blogs.msdn.com/infopath/). I just use the InfoPath
2007 Managed Object Model Poster
(http://www.microsoft.com/downloads/...45-9D27-4D1F-ACD1-9B950637D64E&displaylang=en)
or Object Browser in Visual Studio to find what I need.

If you get stuck again, just post your question and perhaps someone might be
able to help!
---
S.Y.M. Wong-A-Ton


Josiah Smith said:
Thank you very much!!

Do you know where I could get more step-by-step info on switching to the new
object model?

Josiah Smith

S.Y.M. Wong-A-Ton said:
Try

DataConnections["SaveAsTestC# Submit"].Execute();

Notice the square brackets I used instead of the round ones you used?
---
S.Y.M. Wong-A-Ton


:

I am attempting to learn what it will take to transform our 2500+ lines of
JScript in IP 2k3 to C# in IP 2k7. I've been able to stumble my way around
with a few basic things, but am having trouble with custom submit code, and
will probably have trouble with an equivalent for open.

For the custom submit code, I tried the following,
<code>
DataConnections("SaveAsTestC# Submit").Execute();
</code>
but got an error of
'Microsoft.Office.InfoPath.XmlFormHostItem.DataConnections' is a 'property'
but is used like a 'method'

I haven't even tried to tackle the new object model equivalent for
NewFromSolution, let alone Application.XDocument.Open()...

I'm trying to learn the new IP 2k7 MOM, but obviously, over the past year,
there's been a lot less community experience with IP 2k7 than there is for IP
2k3 to draw from. It would even help if I could get the completed, or more
current help files for IP 2k7.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top