Reference .NET Code

M

Martyn Lawson

Hi,

I have been struggling to calculate the difference between 2 dates and
populate another field. I have found a blog:
http://blogs.msdn.com/infopath/archive/2005/01/25/360318.aspx which explains
how to do it but not where to put the code.

I have managed to create the onafterchange events for the two date fields,
but where do i put the rest of the code?

Any help would be greatly appreciated,

Cheers,
Martyn...
 
S

SBFF

That blog talks about using .NET managed code. Which means you need to use
..NET (not just the simple JScript stuff that ships with InfoPath).
If you are using InfoPath SP1 with the InfoPath SDK, you should be able to
put that into the event handler code (in VStudio.NET). Based on your
question, I am guessing that you aren't seeing VStudio.NET.
If you don't have SP1 & the SDK installed, you have 2 options:
1. start digging around for how to do the same thing via JScript (in the
Microsoft Script Editor). ...not the easiest for development but much
easier for deployment...
or
2. install SP1 and the SDK, then do it via VStudio code. ...easier for
development, but ALL of you users will need SP1. Which could end up being a
big headache...

If you already have sp1 & the sdk installed and you still don't see VStudio,
try opening Visual Studio .net 2003 and create a new project. Do "Microsoft
Office InfoPath Projects", "Visual Basic Projects", InfoPath Form Template
(if that is not on the list, it means that you haven't installed IPsp1 and
the SDK). It will ask you if you want to create a new infopath form or use
an existing form. Pick your existing form. Finish. Then, when you hit the
code behind your button, you will pop into VStudio and you will be able to
use the VB date manipulation assemblies.

Good luck
- SBFF -
 

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