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 / April 2005

Tip: Looking for answers? Try searching our database.

Open Infopath by clicking on the URL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Reetu Agarwal - 21 Mar 2005 20:30 GMT
Hi All,

I have an infopath form. On submit an email is sent to the user containing
the Url of the infopath form.
Eg http://SharePointservername/Sites/SiteName/FormLibrary/FileName.xml

I want to open the infopath form directly when the user clicks on this url.
I save the infopath form to the Form Library. There I can click on the
infopath icon and the Infopath form is opened directly. Similarly I want to
click on the url sent in the email and it should open the Infopath form.

I looked at the view source and there Sharepoint uses DispDocItemEx()
javascript function (contained in ows.js file) to open the infopath form.I
tried to do something similar but it does not open the form.
Can someone help with this?

<A onfocus="OnLink(this)" HREF="http://SPserver/sites/IDX-InfoPath/IDX%
20Users/aaa.xml" onclick="DispDocItemEx(this,'FALSE','FALSE','FALSE','')
">aaa</A>

Thanks & Regards,
-Reetu
Greg Collins [InfoPath MVP] - 21 Mar 2005 20:54 GMT
The form will open based on the processing-instruction (PI) at the top of the .xml file. This PI says where the form template is located. You shouldn't need anything special. As long as the PI is there and the template still exists, the form should open by clicking the link -- whether from email or otherwise (provided the user has access to the template).

Signature

Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com

Hi All,

I have an infopath form. On submit an email is sent to the user containing
the Url of the infopath form.
Eg http://SharePointservername/Sites/SiteName/FormLibrary/FileName.xml

I want to open the infopath form directly when the user clicks on this url.
I save the infopath form to the Form Library. There I can click on the
infopath icon and the Infopath form is opened directly. Similarly I want to
click on the url sent in the email and it should open the Infopath form.

I looked at the view source and there Sharepoint uses DispDocItemEx()
javascript function (contained in ows.js file) to open the infopath form.I
tried to do something similar but it does not open the form.
Can someone help with this?

<A onfocus="OnLink(this)" HREF="http://SPserver/sites/IDX-InfoPath/IDX%
20Users/aaa.xml" onclick="DispDocItemEx(this,'FALSE','FALSE','FALSE','')
">aaa</A>

Thanks & Regards,
-Reetu
Reetu Agarwal - 21 Mar 2005 21:56 GMT
Thanks a lot Greg. It worked :)

Regards,
-Reetu
Ken K - 11 Apr 2005 23:47 GMT
This is exactly what I would like to do, could you tell me how to send an
email with a URL link to a user?  Is this using a button on the form?

> Hi All,
>
[quoted text clipped - 18 lines]
> Thanks & Regards,
> -Reetu
Reetu Agarwal - 12 Apr 2005 00:28 GMT
Hi,

I have a submit button on the form.
When the user clicks on submit button I am passing the forms xml data to
the webservice. In the webservice I am constructing the url and then I am
using .Net API to send the mail.

Please let me know if you need any help.

Thanks & Regards,
-Reetu
Ken K - 12 Apr 2005 04:03 GMT
Unfortunately I don't know how to do that.
Would you be so kind as to send me the code?

> Hi,
>
[quoted text clipped - 7 lines]
> Thanks & Regards,
> -Reetu
Reetu Agarwal - 12 Apr 2005 18:01 GMT
Hi,

I dont have the code in one file. I am using several files. I tried to list
the required code.
I hope this helps. Let me know if you have any questions.

1) In InfoPath form go to Tools--> data connections --> click add -->
    select submit --> select to a web service --> provide the url of the .net
web service and then select the name of the function in the webservice
which wil accept the string data.

2)Below I have listed the function in the web service which will accept the
infopath data.

[WebMethod]
public string GetXmlData(string xmlData)
{
        string url = string .empty;
        // Converts the string data to TextReader object
        TextReader textReaderObj =  new StringReader(xmlData);
        DataSet dsAppXmlData = new DataSet();
        // Reads the xml data in dataset
        dsAppXmlData.ReadXml(textReaderObj);

        foreach(DataRow drRowAppXmlData in dsAppXmlData.Tables[0].Rows)
        {
        // Initially I saved the infopath form to the form library in
sharepoint.There I checked the default url              that sharepoint provided to
open the form. In my case the url was         http://servername/sitename/form
library name/ + lastname + firstname + ".xml";

        The firstname and lastname are the fields on the infopath form. Based on
the above url I constructed the         url dynamically as shown below.
       
       
        // here you need to replace the servername, sitename, form libraray name
url = http://servername/sitename/form libraray name +
            drRowAppXmlData["LastName"].ToString().Trim() +                     drRowAppXmlData
["FirstNametName"].ToString().Trim() +".xml";
       
        }

        return url;
}

3) Once you have the url craete a separate function to send the email

// In the code below you need to assign your own values for strFrom,
subject which will contain the url etc.

code to send the mail

using System.Web.Mail;

// sends an email using the .Net MailMessage class
MailMessage mail = new MailMessage();
mail.From = strFrom;
mail.Subject = subject;
mail.Priority = MailPriority.Normal;

mail.BodyFormat = MailFormat.Text;
mail.Body = body;
mail.To = strTo;
mail.Cc = strCC;
SmtpMail.SmtpServer = SMTP Server;
SmtpMail.Send(mail);

Regards,
-Reetu
Ken K - 12 Apr 2005 18:11 GMT
Thank you so much for replying and for the code.
It looks like it is just what I need.
Wish me luck and thanks again.

Ken K

> Hi,
>
[quoted text clipped - 65 lines]
> Regards,
> -Reetu
 
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.