Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2008

Tip: Looking for answers? Try searching our database.

Code Backed Forms in Infopath

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BigJohnW - 21 Mar 2008 12:29 GMT
Hi,
I have created an infopath form which contains fields for Active Directory
lookups. Several fields query the AD and display user related data - Name,
Title, Manager, stuff like that. I've signed the form with a certificate and
published the form successfully to Sharepoint (MOSS2007) so that it published
in a browser. However, when I try to open the form in a browser from
Sharepoint, before the form is displayed, it errors and says an error has
been entered into the Server Application Event log. This is a 5337 error ID
and states:

Business logic failed due to an exception. (User: Domain\MyUserName, Form
Name: Holiday Request Form, IP: , Request:
http://web/_layouts/FormServer.aspx?XsnLocation=http://web/sites/MOSS/FormServerTemplates/Holiday+Request+Form.xsn&SaveLocation=http://web/sites/MOSS/Public/Public&Source=http://web/sites/MOSS/Public/Public/Forms/AllItems.aspx&DefaultItemOpen=1,
Form ID:
urn:schemas-microsoft-com:office:infopath:Holiday-Request-Form:-myXSD-2008-03-07T12-43-21,
Type: COMException, Exception Message: An operations error occurred.)

If I click continue, the form displays correctly in a browser but without
the code based fields being populated.

I've been told in another Forum (Sharepoint Portal Server) that this is a
problem with the code I have used. However, when I preview the form inside
Infopath (2007) the form loads and displays correctly and all fields are
properly populated, so I assumed the code is correct.

I can post my code here if required.

I have added a reference for System.DirectoryServices and put Imports
System.DirectoryServices at the top of the form. I then posted my code to the
Loading Event and when I build the form inside Microsot Visual Studio Tools
for Applications the form builds error free.

I don't think I've missed anything , except the code, which I can post if
required.

Please can anyone advise on why I am getting this error and how to cure it
so that my form loads properly in a browser and populates the required fields?

Many Thanks

John
Clay Fox - 21 Mar 2008 17:51 GMT
Not seeing my initial reply so trying again.

I do not think that code is supported in a browser form.

I have a web service which queries Active Directory information and is
browser compatible.
Email me if you would like to see it.
http://www.infopathdev.com/members/clayfox.aspx
Signature

Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum

> Hi,
> I have created an infopath form which contains fields for Active Directory
[quoted text clipped - 37 lines]
>
> John
BigJohnW - 28 Mar 2008 17:16 GMT
Hello Clay,

Thaks for the reply, sorry its taken a while to reply, been very busy!

I've logged onto the forum, can't find the web service. Can you direct me
please?

Thanks

> Not seeing my initial reply so trying again.
>
[quoted text clipped - 46 lines]
> >
> > John
Clay Fox - 28 Mar 2008 17:21 GMT
Here is a page about it.
http://www.qdabra.com/proddetail.asp?prod=QADWS
The video is pretty good.

It also comes bundled with several web services for dynamic queries of SQL
and dynamic submits which may also be of interest.
Email me if you would like to see a quick demonstration.

Signature

Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum

> Hello Clay,
>
[quoted text clipped - 55 lines]
> > >
> > > John
BigJohnW - 28 Mar 2008 18:25 GMT
Hi Clay,

Thanks for the Post, I've had a look, seems pretty good.
I'm not 100% sure about whether we need to buy a Web Service.
Can anyone else confirm that code cannot be used in an infopath form?
I have been posting on another MS Site prior to this one and nobody said
there browser froms can't be code based.
Can anyone out there confirm this? The form performs perfectly in Infopath
during preview.
I got the base code off a post on a different Newsgroup, it seemed to imply
you could put code into forms.
I know if I ask my boss to buyt the Web Service, he will ask these
questions, so I'm just covering my bases.
Thanks for your help earlier, Clay, I'm not disputing you are wrong, just
checking.
No offense intended.
Regards,
John

> Here is a page about it.
> http://www.qdabra.com/proddetail.asp?prod=QADWS
[quoted text clipped - 63 lines]
> > > >
> > > > John
Clay Fox - 28 Mar 2008 18:31 GMT
No Problem.

Those are legitimate questions.

You can run code in Browser based forms fine.

The issue becomes what the code is doing and trust issues.

Also since your form is in the browser, there is less interactivity, post
backs are handled differently.
There may be some code that will work in a browser to get userid.

The nice thing with the AD web service is that it is reusable and easy for
form designers to use.  It is codeless so you can publish browser forms with
out the additional steps of Admin approval and you can use it to get
additional employee information such as email, department, etc.

Signature

Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum

> Hi Clay,
>
[quoted text clipped - 82 lines]
> > > > >
> > > > > John

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.