Microsoft InfoPath 2010
The official blog of the Microsoft InfoPath team

  • Microsoft InfoPath 2010

    MSDN Webcast: Using Managed Code and Visual Studio to Build Solutions

    • 1 Comments

    Hello everyone,

    I hope you will join us for the next presentation in the InfoPath WebCast series - Using Managed Code and Visual Studio to Build Solutions. This talk will be presented by Willson Raj David, a developer in the InfoPath group, tomorrow starting at 1pm PST.  If you haven’t already, you can register here: http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032259539&Culture=en-US.

    Also, remember that those of you who view the talk and fill out a survey will be entered into a drawing for a copy of Halo2.  (The Halo2 promotion is for US Residents only.  Microsoft employees are not eligible.)

    Here is more information about the talk:

    MSDN Webcast: Using Managed Code and Visual Studio to Build Solutions—Level 300    

    Start Time:       Tuesday, November 02, 2004 1:00 PM (GMT-08:00) Pacific Time (US & Canada) 
    End Time:        Tuesday, November 02, 2004 2:30 PM (GMT-08:00) Pacific Time (US & Canada) 

    Event Description 
    Learn where Microsoft® Office InfoPath™ fits into the Microsoft® Office family. Find out about the Object Model and business logic programmability features in the product as well as the Microsoft® Visual Studio® Toolkit and managed code support that is available in InfoPath.

    Presenter: Willson Raj David, Software Design Engineer, Microsoft Corp.

    Willson Raj David is a developer in the Microsoft® Office InfoPath™ product division and has been with the product team for at least four years. He primarily worked on the Designer controls and other features. Willson’s core expertise is Microsoft® C++® and COM and he also has extensive knowledge in many Web technologies.

    Thank you,
    Scott

  • Microsoft InfoPath 2010

    Yesterday's InfoPath WebCast: MSDN Webcast: Business Logic in InfoPath 2003

    • 0 Comments

    Hello all,

    I want to start by apologizing to all of you who tried to connect to yesterday’s WebCast.  We had some network issues that were preventing most people from connecting.  However, the WebCast was recorded and is available on-demand via the following URL: http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259112&Culture=en-US

    If you weren’t able to view it yesterday, I hope you will take the time to view the recording.  The talk was very interesting and informative.

    I also hope you will join us next Tuesday, November 2nd for the next presentation in the InfoPath Webcast series “Using Managed Code and Visual Studio to Build Solutions” which will be presented by Willson Raj David, a developer on the InfoPath team.  I think we have all the kinks worked out so there shouldn’t be any problems connecting to the Live Meeting.  Also, remember that attendees who are not Microsoft employees who view the entire Webcast and fill out a survey at the end will be entered into a drawing for Halo 2.  (The contest is open to US residents only.  Full contest rules will be posted shortly.)

    You can register for next week’s talk through the following URL: http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032259539&Culture=en-US

    Here is more information about the talk:

    MSDN Webcast: Using Managed Code and Visual Studio to Build Solutions—Level 300    

    Start Time:       Tuesday, November 02, 2004 1:00 PM (GMT-08:00) Pacific Time (US & Canada) 
    End Time:        Tuesday, November 02, 2004 2:30 PM (GMT-08:00) Pacific Time (US & Canada) 

    Event Description
    Learn where Microsoft® Office InfoPath™  fits into the Microsoft® Office family. Find out about the Object Model and business logic programmability features in the product as well as the Microsoft® Visual Studio® Toolkit and managed code support that is available in InfoPath.

    Presenter: Willson Raj David, Software Design Engineer, Microsoft Corp.

    Willson Raj David is a developer in the Microsoft® Office InfoPath™ product division and has been with the product team for at least four years. He primarily worked on the Designer controls and other features. Willson’s core expertise is Microsoft C++ and COM and he also has extensive knowledge in many Web technologies.

    Thank you,
    Scott Roberts

  • Microsoft InfoPath 2010

    MSDN Webcast: Business Logic in InfoPath 2003

    • 1 Comments

    I want to thank all of you who have attended one or more of the talks in the InfoPath Webcast series which started this month and goes until the middle of December.  Now, I am happy to announce that those of you who have attended previous Webcasts and filled out a survey and those of you who attend the upcoming Webcasts will be eligible to win a copy of Halo 2.  (Microsoft Employess are not Eligible.)  Each time you attend a talk and fill out a survey, you are entered into the drawing.  So, attend as many of the Webcasts are you can.

     

    The full contest rules will be available on http://office.microsoft.com/infopath in the next few days.

     

    Also, please don’t miss tomorrow’s Webcast: Business Logic in InfoPath 2003 starting at 11:00 am PST.

     

    Here is more information about tomorrow’s Webcast.

     

    MSDN Webcast: Business Logic in InfoPath 2003—Level 300    

     

    Start Time:  Tuesday, October 26, 2004 11:00 AM (GMT-08:00) Pacific Time (US & Canada) 

    End Time:   Tuesday, October 26, 2004 12:30 PM (GMT-08:00) Pacific Time (US & Canada) 

     

    Event Description 

    Learn how to create a simple schema validation and custom data validation using pattern-matching and creating script-based validation using the OnValidate event. See how to use formulas to calculate totals and construct an e-mail address. And how to use conditional formatting to call attention to a text box value and use rules to display a message box and to set the value for another field.

     

    Presenters: Yuet (Emily) Ching and Prachi Bora, Software Test Engineer, Microsoft Corp.

     

    Yuet (Emily) Ching has been a Software Test Engineer with the Microsoft® Office InfoPath™ team since SP1. Emily owned several SP1 features such as Rules, Pattern, Conditional Formatting, Conditional Disabling and Data Formatting. Prachi Bora has been a Software Test Engineer with the InfoPath team since Sep 2003 (SP1). She tested the Object model for SP1.

     

    - Scott

  • Microsoft InfoPath 2010

    Tuesday's Webcast

    • 0 Comments

    I want to personally thank those of you who attended yesterday’s WebCast: Building Advanced Dynamic Solutions in InfoPath 2003 which was presented by Jun Jin.  I hope you enjoyed the talk as much as I did and were able to learn something new.  If you were unable to attend the talk, don’t worry.  It was recorded and is available via the following URL: http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259111&Culture=en-US.  (You will have to register before you can view the recorded WebCast.)

    Please join us next Tuesday, October 26 from 11am – 12:30am PST for the next presentation in the InfoPath WebCast series: Business Logic in InfoPath 2003 which will be presented by Yuet (Emily) Ching and Prachi Bora.  You can register for this talk by clicking on the following URL: http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032259112&Culture=en-US.  I hope you will join us.

    Here is more information about the talk:

    MSDN Webcast: Business Logic in InfoPath 2003—Level 300    

    Start Time:  Tuesday, October 26, 2004 11:00 AM (GMT-08:00) Pacific Time (US & Canada
    End Time:   Tuesday, October 26, 2004 12:30 PM (GMT-08:00) Pacific Time (US & Canada

    Event Description:   Learn how to create a simple schema validation and custom data validation using pattern-matching and creating script-based validation using the OnValidate event. See how to use formulas to calculate totals and construct an e-mail address. And how to use conditional formatting to call attention to a text box value and use rules to display a message box and to set the value for another field.

    Presenters: Yuet (Emily) Ching and Prachi Bora, Software Test Engineer, Microsoft Corp.

    Yuet (Emily) Ching has been a Software Test Engineer with the Microsoft® Office InfoPath™ team since SP1. Emily owned several SP1 features such as Rules, Pattern, Conditional Formatting, Conditional Disabling and Data Formatting. Prachi Bora has been a Software Test Engineer with the InfoPath team since Sep 2003 (SP1). She tested the Object model for SP1.

    Thank you,
    Scott

  • Microsoft InfoPath 2010

    MSDN Webcast: Building Advanced Dynamic Solutions in InfoPath 2003

    • 1 Comments

    Hello everyone,

    I hope you will join us for the next WebCast in the InfoPath series - Building Advanced Dynamic Solutions in InfoPath 2003. This talk will be presented by Jun Jin, a developer in the InfoPath group, tomorrow starting at 9am PST.  If you haven’t already, you can register here: http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032259110&Culture=en-US.

    Here is more information about the talk:

    MSDN Webcast: Building Advanced Dynamic Solutions in InfoPath 2003—Level 200

    Start Time:  Tuesday, October 19, 2004 9:00 AM (GMT-08:00) Pacific Time (US & Canada)
    End Time:Tuesday, October 19, 2004 10:30 AM (GMT-08:00) Pacific Time (US & Canada)

    Event Description

    Description:      Interested in learning more about the new Microsoft® Office InfoPath™ 2003 features for script-less, rapid development? This session will show how you can take advantage of declarative business logic features such as rules and actions, roles identity, advanced controls like file attachments, master-detail, and filtering. There is also built-in support for calculations to build advanced and dynamic solutions.   Finally, learn how to use e-mail deployment to deliver InfoPath solutions that allow you to easily gather data from your users.

    Presenter: Jun Jin, Software Design Engineer, Microsoft Corp.
    Jun Jin is a Software Design Engineer in the Microsoft® Office InfoPath™ team. He has been with the InfoPath team since version 1 working mainly on controls in the Designer.

    - Scott

  • Microsoft InfoPath 2010

    Tuesday’s InfoPath WebCast: User Roles in InfoPath 2003

    • 0 Comments

    Another note from Scott Roberts:

    I want to personally thank those of you who attended Tuesday’s WebCast: User Roles in InfoPath 2003.  I hope you enjoyed the talk and were able to learn something new.  If you were unable to attend the talk, don’t worry.  It was recorded and is available via the following URL: http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259537&Culture=en-US.  (You will have to register before you can view the recorded WebCast.)

    Please join us next Tuesday, October 19 from 9am – 10:30am PST for the next presentation in the InfoPath WebCast series: Building Advanced Dynamic Solutions in InfoPath 2003 which will be presented by Jun Jin.  You can register for this talk by clicking on the following URL: http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032259110&Culture=en-US.  I hope you will join us.

    Here is more information about the talk:

    MSDN Webcast: Building Advanced Dynamic Solutions in InfoPath 2003—Level 200  
          Start TimeTuesday, October 19, 2004 9:00 AM (GMT-08:00) Pacific Time (US & Canada)
     End TimeTuesday, October 19, 2004 10:30 AM (GMT-08:00) Pacific Time (US & Canada)
     
    Event Description
     DescriptionInterested in learning more about the new Microsoft® Office InfoPath™ 2003 features for script-less, rapid development? This session will show how you can take advantage of declarative business logic features such as rules and actions, roles identity, advanced controls like file attachments, master-detail, and filtering. There is also built-in support for calculations to build advanced and dynamic solutions. Finally, learn how to use e-mail deployment to deliver InfoPath solutions that allow you to easily gather data from your users.

    Presenter: Jun Jin, Software Design Engineer, Microsoft Corp.

    Jun Jin is a Software Design Engineer in the Microsoft® Office InfoPath™ team. He has been with the InfoPath team since version 1 working mainly on controls in the Designer.

     

  • Microsoft InfoPath 2010

    MSDN Webcast: User Roles in InfoPath 2003

    • 0 Comments

    If you haven’t already, you may want to sign up for tomorrow’s WebCast - User Roles in InfoPath 2003 – that will be presented by Josh Bertsch, a Software Test Engineer on the InfoPath team.  In this talk, you will learn about the support for user roles that was added in SP1.  To register, please visit the following URL: http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032259537&Culture=en-US.

     

    Here is more information about tomorrow’s WebCast:

     

    MSDN Webcast: User Roles in InfoPath 2003—Level 200

     

    Description:

     

    Would you like to see just how easy Microsoft® Office InfoPath™ is to use? Join this webcast to discover how to create a view and user roles for a form, set up rules based on the roles, and preview a form with specific user roles. You will also learn how to switch views based on user roles.

     

    Josh Bertsch, Software Test Engineer, Microsoft Corp.

    Josh Bertsch has been a Software Test Engineer with the Microsoft® Office InfoPath™ team for nearly 3 years. Josh owned several of the newly included features for the SP1 release, such as Calculations and Roles, among others.

  • Microsoft InfoPath 2010

    Using Relink When Moving a SharePoint Form Library to a New Site

    • 8 Comments

    When InfoPath form files are saved to a SharePoint Form Library, SharePoint creates hard-coded references to the form template in the team site where the forms are being saved.  If the SharePoint Form Library is moved to a new location, the references in the InfoPath form files will continue to point to the old location, even after they've been moved into the new Form Library. In order to fix up the references in the form files to point to the new form template location, you need to perform a Relink operation.

    Important   Before performing the Relink operation, make sure that the Windows SharePoint Services server you are working with has been updated with Windows SharePoint Services Service Pack 1. This service pack release fixes a bug that can cause data corruption when performing a Relink operation.

    Note   You cannot relink a form if the all data in the form has been digitally signed (the form template has been configured for signing by using the Enable digital signatures for the entire form option, or by using the Enable digital signatures for specific data in the form option with the Set of signable data specified using an XPath expression of "/"). This is because when a form has been signed using this configuration the link to the form template is treated as part of the form data, and relinking would invalidate the signature. You can relink a form that has only part of the data signed (the form template has been configured for signing by using the Enable digital signatures for specific data in the form option with the Set of signable data specified as a subset of the data). For more information on using digital signatures, see Digitally Signing Data in InfoPath 2003.

    Here are the steps for performing a Relink operation:

    1. Open the new form library.
    2. Click Modify Columns and Settings to the left of the view.
    3. Under General Settings, click Relink forms to this form library.
    4. In the view presented, select all of the forms that you want to relink.
    5. Click the Relink button.

    The references in all of the forms you selected in step 4 will now point to the current form library location.

    Note   It is also possible to update the references in the form files using the Processing Instruction Update Tool provided with the InfoPath 2003 Software Development Kit (SDK); however in most cases the using the procedure above is simpler.

  • Microsoft InfoPath 2010

    WebCast: Best Practices for Designing InfoPath Forms

    • 0 Comments

    Here's a quick note from Scott Roberts, a developer on the InfoPath team who presented the WebCast:

     

    I want to personally thank those of you who attended yesterday’s WebCast: Best Practices for Designing InfoPath Forms.  I hope you enjoyed the talk and were able to learn something new.  If you were unable to attend the talk, don’t worry.  It was recorded and is available via the following URL: http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032259532&Culture=en-US.  (You will have to register before you can view the recorded WebCast.)

     

    Also, please join us next Tuesday, October 9 from 9am – 10:30am PST for the next presentation in the InfoPath WebCast series: User Roles in InfoPath 2003.  You can register for this talk by clicking on the following URL: http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032259537&Culture=en-US.  I hope you will join us.

     

    Here is more information about the talk:

     

    MSDN Webcast: User Roles in InfoPath 2003—Level 200

     

    Description:

     

    Would you like to see just how easy Microsoft® Office InfoPath™ is to use? Join this webcast to discover how to create a view and user roles for a form, set up rules based on the roles, and preview a form with specific user roles. You will also learn how to switch views based on user roles.

     

    Josh Bertsch, Software Test Engineer, Microsoft Corp.

    Josh Bertsch has been a Software Test Engineer with the Microsoft® Office InfoPath™ team for nearly 3 years. Josh owned several of the newly included features for the SP1 release, such as Calculations and Roles, among others.

    Presenter:

     

    Thank you,

    Scott

     

  • Microsoft InfoPath 2010

    Problems When Calling into Script Functions in a Task Pane from Managed Code

    • 1 Comments

    We have been receiving questions about problems deploying some InfoPath solutions created with the InfoPath 2003 Toolkit that call into script functions in a task pane from managed code. These solutions work on the developer's machine, but then fail when deployed on user's machines if the MSHTML primary interop assembly (PIA) - microsoft.mshtml.dll - is missing.

    This problem is caused by InfoPath object model members that return types from the MSHTML PIA. The MSHTML PIA is installed by default with Visual Studio .NET 2003, but is not installed by InfoPath 2003 SP1 or with the .NET Framework. As a result, when the solution is deployed on a machine missing the MSHTML PIA, the solution throws an exception.

    There are two ways to resolve this issue: 1) Install and register the MSHTML PIA on the user's machine, or 2) Use late binding in your form code to call such functions.

    Installing the MSHTML PIA on User's Machines

    The MSHTML PIA is a redistributable component installed with Visual Studio .NET 2003 (as defined in the <drive>:\Program Files\Microsoft Visual Studio .NET 2003\redist.txt file), so you can deploy it on all client machines where you want the solution to run. Refer to the End User License Agreement (EULA) for your edition of Visual Studio .NET 2003 for terms and conditions on redistributing components.

    The MSHTML PIA (microsoft.mshtml.dll) needs to be copied to the user's machine, installed in the Global Assembly Cache (GAC) using the Global Assembly Cache tool (gacutil /i microsoft.mshtml.dll), and then registered using the Assembly Registration Tool (regasm microsoft.mshtml.dll).

    Using Late Binding to Call Script Functions From Managed Code

    You may also consider using late-bound calls to objects previously passed by the task pane script to the managed code in your form code. The following is a code fragment that shows how to do this by using the InvokeMember method of the System.Type class in the .NET Framework. Note that the managed code requires FullTrust permissions to work with late-bound calls. For more information on FullTrust permissions and how to deploy form templates that require this permission set, see Understanding Fully Trusted Forms.

    Taskpane.htm:

    <HTML>
    <script>
       function Initialize()
       {
          var XDoc = window.external.XDocument;
          XDoc.Extension.SetTaskPaneWindow(window);
       }

       function MyScriptFunc(s)
       {
          window.alert(s);
       }
    </script>

    <BODY onload="Initialize();" />
       // Remaining taskpane HTML goes here.
    </BODY>
    </HTML>

    FormCode.cs:

    private XDocument      thisXDocument;
    private Application    thisApplication;
    private object         taskPaneWindow;
       ...

    // Note: The MatchPath attribute should match your control's ID.
    [InfoPathEventHandler(MatchPath="CTRL1_5", EventType=InfoPathEventType.OnClick)]
       public void CTRL1_5_OnClick(DocActionEvent e)
       {
          object[] args =  new object[] {"Hello from InfoPath script"};

          // Call into script through CLR late binding using the InvokeMember method.
          taskPaneWindow.GetType().InvokeMember(
             "MyScriptFunc",              // late-bound method
             BindingFlags.InvokeMethod |  // binding flags
             BindingFlags.DeclaredOnly |
             BindingFlags.Public |
             BindingFlags.Instance,
             null,                        // binder object
             taskPaneWindow,              // target object
             args);
       }

       public void SetTaskPaneWindow(object window)
       {
          taskPaneWindow = window;
       }

  • Microsoft InfoPath 2010

    What check box was clicked?

    • 0 Comments

    In a previous blog post we answered the question "What button was clicked?" when a Button control is inside a repeating context like a Repeating Section control. A similar situation has a slightly different answer that's worth calling out for those readers still learning about XPaths and InfoPath's events.

    Here's a different schema:

    • Root
      • People
        • Person
          • Name
          • IsApproved

    And you could build a form like this:

    The previous blog would have let you get from the Button's OnClick event to the data items in the row. But what about the Check Box?

    The Button is an unbound control, so it doesn't have data change events, just OnClick. And in the event object, the Source is the Button's context (the Person node in this case)

    The Check Box is a bound control (bound to the IsApproved node) so it has data change events instead: OnBeforeChange, OnValidate, and OnAfterChange. And the Source will be the node that actually changes.

    Tricky Bit #1: In an XML DOM, the nodes aren't just elements and attributes. The text contents of elements are nodes themselves. So when a user checks the Check Box, the node that changes is not the IsApproved node, but the text node inside! So the Source will be a text node. If you add this to the OnAfterChange for the IsApproved node, you'll see that the Source is just the text node:

    XDocument.UI.Alert( eventObj.Source.xml );

    Tricky Bit #2: If you check the checkbox, you'll actually see two alerts - first with "false" then with "true". To make this clearer, change the code as follows:

    XDocument.UI.Alert(
        "Source: " + eventObj.Source.xml + "\n" +
        "Operation: " + eventObj.Operation
    );

    You'll see that the first operation was a "Delete" of the "false" value, followed by an "Insert" of the "true" value. This shows just how fine grained the InfoPath data eventing model is.

    So, back to the problem at hand - how do we get at the other items in the row?

    For Tricky Bit #1, you can either add an extra ".." step in your XPath to step up from the text node, or use the Site property of the event object instead. The Site is this is the node where the event is being processed, and since the event handler is on the IsApproved element, the node will be the IsApproved element. (Note that a Button's event object is a different type, and only contains Source not Site, since the event doesn't bubble.)

    For Tricky Bit #2, you can simply ignore every operation type other than "Insert".

    Putting all of that together, you'll end up with event-handling logic like this:

    if( eventObj.Operation == "Insert" )
    {
        XDocument.UI.Alert( eventObj.Site.selectSingleNode( "../my:Name").text );
    }

    One last note - in the form shown, this event will fire and an alert will be shown whenever a new row is inserted into the table. So depending on what you are trying to accomplish, you might also want to filter out default values - such as empty strings - from further processing.

  • Microsoft InfoPath 2010

    Introducing MSDN Web-casts for Microsoft Office InfoPath 2003

    • 0 Comments

    Keep hearing the buzz around Microsoft Office InfoPath 2003 and want to learn more? Excited about the feature enhancements in InfoPath 2003 SP1 and want to really understand how to use them in your applications? Want to learn cool tips and tricks on how to make your applications stand out? Want to learn how the InfoPath product team, product developers and testers use InfoPath and want to hear their recommendations on make use of the cool new features? Want 100% developer content without any marketing hype? If this resonates with you, you will not want to miss the ten part MSDN web-cast series starting in October and lasting through December 2004. In addition to showcasing best practices, each web-cast is designed to highlight the InfoPath 2003 SP1 feature enhancements. Topics covered will include using Visual Studio .NET and managed code to create InfoPath applications, using custom controls in InfoPath applications, managing users and roles in workflow, using script-less calculations, adding security features in your applications through digital signatures and much more. The web-cast series also offers you the opportunity to interact directly with the product team. For hard core technical content, that you cannot find elsewhere, this is a not to be missed series.

    The following is the schedule of presentations starting in October:

    Title

    Presenter

    Date

    Time

    Best Practices for Designing InfoPath Forms

    Scott Roberts

    Tuesday, October 05, 2004

    9:00 AM-10:30 AM

    http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259531&Culture=en-US

    User Roles in InfoPath 2003

    Josh Bertsch

    Tuesday, October 12, 2004

    9:00 AM-10:30 AM

    http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259537&Culture=en-US

    Building Advanced Dynamic Solutions in InfoPath 2003

    Jun Jin

    Tuesday, October 19, 2004

    9:00 AM-10:30 AM

    http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259110&Culture=en-US

    Business Logic in InfoPath 2003

    Yuet (Emily) Ching and Prachi Bora

    Tuesday, October 26, 2004

    11:00 AM-12:30 PM

    http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259112&Culture=en-US

    Using Managed Code and Visual Studio to Build Solutions

    Willson Raj David

    Tuesday, November 02, 2004

    1:00 PM-2:00 PM

    http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259539&Culture=en-US

    InfoPath in End-to-End Enterprise Solutions: Integrating InfoPath with Siebel and SAP

    Hagen Green

    Monday, November 08, 2004

    11:00 AM-12:30 PM

    http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259542&Culture=en-US

    Digital Signatures in InfoPath 2003

    Mihaela Cristina Cris

    Monday, November 15, 2004

    11:00 AM-12:30 PM

    http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259544&Culture=en-US

    Creating Custom Controls for InfoPath SP-1

    Andrew Ma

    Monday, November 29, 2004

    11:00 AM-12:30 PM

    http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259546&Culture=en-US

    Programming Workflow into InfoPath Solutions: Using InfoPath with BizTalk Server 2004 and Human Workflow Services

    Rick Severson

    Monday, December 06, 2004

    11:00 AM-12:30 PM

    http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259548&Culture=en-US

    Database Connectivity in InfoPath Through ADO.NET DataSet Support

    Mikhail Vassiliev

    Tuesday, December 14, 2004

    11:00 AM-12:30 PM

    http://msevents.microsoft.com/cui/eventdetail.aspx?EventID=1032259550&Culture=en-US

    All times are Pacific Daylight Time (UTC–07:00) until Oct 31, and Pacific Standard Time (UTC–08:00) on and after Oct 31st.

    For details, and to sign up to participate in this series, please click on one of the hyperlinks above.

     

  • Microsoft InfoPath 2010

    InfoPath Quick Tip: Setting a User Role as the Initiator

    • 3 Comments

    In Microsoft Office InfoPath 2003, you can assign users to distinct categories, called user roles, which are based on job title or other criterion. InfoPath can perform custom actions that vary based on the current user role, such as switching views, conditional formatting, data validation, or filter settings.

    Some InfoPath form designers have found the Set as initiator option for user roles to be somewhat confusing when specifying a role using network accounts. (The Set as initiator option is available when defining a user role by clicking User Roles on the Tools menu, and then clicking Add). Setting a user role as the initiator will cause InfoPath to use that role whenever a new blank form is opened for the first time regardless of how the user is logged on to the network. However, the next time that user opens the same form, InfoPath will use the person's assigned user role instead of the initiator role

    For example, suppose you create a form template with an Employee View and a Manager View and then create a rule to switch views based on whether the current user role is Employee or Manager as demonstrated in Lab 7: User Roles in InfoPath 2003. Because the Employee role is set as the initiator, when a user creates new blank form, InfoPath will always set the user role to Employee even if the current user is not a member of the network group or user accounts specified for the Employee user role. As a result, InfoPath will always switch to the Employee View the first time a user creates a new blank form. Only after the form is saved and re-opened will the rule be applied based on the user role defined for the user's network account.

  • Microsoft InfoPath 2010

    What button was clicked?

    • 3 Comments

    Another question that we get asked a lot:

    I include a Repeating Section control in my form, containing a Button and a Text Box. At runtime, a user inserts 5 items. How do I know which Button was clicked so I can get to the Text Box’s value?

    That’s actually the wrong question to ask. Strictly speaking, InfoPath doesn’t know the difference between the Buttons. They are all identical clones. What’s different about each button is its context within the view, and the view is mapped to the data. (In InfoPath it always comes back to the data.)

    If your schema looks like this:

    • myNodes
      • group1
        • group2 (repeating)
          • field1

    Your view probably looks something this:

    [View Structure]

    Since the Button control is inside the Repeating Section which is bound to group2, we say that the Button’s context is group2.

    So what?

    When the Button event is received, it contains a DocActionEvent object. The event object has a Source property. And this property is the Button’s context node – the specific group2 instance the Button is inside.

    So at this point, you can just use eventObj.Source to refer to data relative to the Button. Probably the easiest thing to do is just do some old school debugging using alerts. Here’s how to make sure you’re getting the context right:

    function CTRL3_5::OnClick(eventObj)

    {

    // Write your code here

    XDocument.UI.Alert( eventObj.Source.xml );

    }

    Here’s what you’d get:

        <my:group2 xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2004-09-14T16:02:14">

            <my:field1>abc</my:field1>

        </my:group2>

    And to wrap things up, to get the text inside the Text Box, you need to use eventObj.Source.selectSingleNode():

    function CTRL3_5::OnClick(eventObj)

    {

    // Write your code here

    XDocument.UI.Alert( eventObj.Source.selectSingleNode("my:field1").text );

    }

  • Microsoft InfoPath 2010

    Filtering using the current() function

    • 7 Comments

    For some reason, the last week has been full of questions where the answer boils down to “use the current() function”.

     

    The current() function is an XSLT XPath function which returns the current node. You can read the full W3C Recommendation if you want the nitty-gritty details, but if you wanted to read the specification you’d probably have done that instead of reading this blog.

     

    You need this function in InfoPath if you’re trying to refer to data across repeating contexts. Some examples:

     

    ·        Within a repeating table row, you want to build cascading drop-downs

    ·        You want select or filter data from another context by data in the current row

    ·        You want one row in a repeating table to refer to data in the previous row

     

    These all come down to the same need – within an XPath expression, how do you say “this one”? That’s what current() is for. Whenever an XPath is being evaluated in a repeating context, current() returns the... well... current item.

     

    Scenario: Within a repeating table row, you want to build cascading drop-downs

     

    If your schema looked like this:

    • Root
      • Data
        • States
          • State (repeating)
        • Cities
          • City (repeating)
            • @state
      • Selection
        • SelectedState
        • SelectedCity

    And you wanted to have drop-downs bound to State and City which select from the appropriate list, you can build cascading drop-downs using filters. You’d end up with a filter on the list-box items that looked like this:

    /Root/Data/Cities/City[ @state = ../../../Selection/SelectedState ]

    (If you used the interactive condition builder, simply select “The expression” in the first drop-down to show the expression as an XPath.)

     

    Now let’s change the schema a bit to put the selections into a table – maybe with notes about each selection:

    • Root
      • Data
        • States
          • State (repeating)
        • Cities
          • City (repeating)
            • @state
      • Table
        • Row (repeating)
          • Selection
            • SelectedState
            • SelectedCity
          • Notes

    If you try this in a Repeating Table row (/Root/Table/Row) you’ll find that it doesn’t work as expected:

    /Root/Data/Cities/City[ @state = ../../../Table/Row/Selection/SelectedState ]

    The XPath /Root/Table/Row/Selection/SelectedState - which for practical purposes here is the same as ../../../Table/Row/Selection/SelectedState - actually returns all of the states in all of the rows, and in XPath the predicate a[b = c] returns all a's where any b equals any c. If you parse that explanation carefully, you'll see that you get far more results than you were expecting. In this example, you get a list of all cities from any of the selected states! What you need is a way to say “just the current Selection/SelectedState”.

     

    The fix then is to modify the XPath to read:

    /Root/Data/Cities/City[ @state = current()/Selection/SelectedState ]

    Scenario: You want select or filter data from another context by data in the current row

     

    This is actually just a simpler version of the previous case.

     

    Whereas a normal list of cities might be:

    /Root/Data/Cities/City

    And a static filtered list would be:

    /Root/Data/Cities/City[ @state = "WA" ]

    A dynamic filtered list would be:

    /Root/Data/Cities/City[ @state = /Root/Selection/SelectedState ]

    To pull the selection from the current table row the final XPath in the predicate needs to be made relative to the current row:

    /Root/Data/Cities/City[ @state = current()/Selection/SelectedState ]

    Scenario: You want one row in a repeating table to refer to data in the previous row

     

    This one is fun – let’s say you had a quiz (a list of true/false questions) and you wanted to disable controls in the current question until the previous question was answered. You’d use Conditional Formatting to disable the controls.

     

    If your schema looked something like this:

    • Root
      • Questions
        • Question (repeating)
          • QuestionText
          • AnswerText

    Then within each row you can use this expression to disable the controls:

    current()/preceding-sibling::Question/AnswerText = ""

    To enter this in the condition builder, select “The expression” in the first drop-down.

     

    (Note: In the example XPaths the namespace prefixes have been left out. Since InfoPath is extremely standards compliant - that is, nitpicky - when it comes to correct namespace usage you’ll need to include these.)

     

    [Edited 2004-09-13 @ 10:37 AM - one of the XPaths was incorrect]

  • Microsoft InfoPath 2010

    Auto-Fill from List Box

    • 8 Comments

    This came up on an internal mailing list:

    We have a secondary data source that holds a list of entries; part of the data in the list - a name field - is used to populate the items in a listbox in the view. When the user selects an item in the list, I want the rest of the data from that entry to be used to populate the form's main data source.

    Great scenario! It actually can be done with a combination of rules and filters (though I admit it’s not obvious), so you don’t have to write code for it.

     

    For this example, I will assume you have a form with:

    • A secondary data source with repeating items (for example, a list of people each with an ID, Name and Age)
    • A dropdown that lists the values in the data source (e.g. displays the name of each person and uses the ID as the value)
    • A set of nodes in your main data source that should be auto-populated when the dropdown changes (e.g. An age textbox that gets the age of the person selected in the dropdown)

    What you’ll need to do is create a rule on the dropdown. The rule will set the value in the textbox by filtering the corresponding value in the secondary data source down to one that matches the dropdown selection.

     

    Here’s how to do it:

    1. Double click the dropdown to open its Properties Dialog (it can be bound to a node in the main data source or in a secondary one, it doesn’t matter)
    2. Click the Rules button
    3. Click Add to add a rule
    4. Click Add Action
    5. For the Action, select Set a field’s Value
    6. For the Field, select the selectedAge node or whatever node you want to set automatically
    7. For the Value, click the Fx button
    8. In the Formula dialog, click Insert Field or Group
    9. In the Data Source dialog, select the secondary data source and then the age node or whatever node you want copy over
    10. Click the Filter button
    11. In the Filter dialog, set the filter to “secondary-data-source-ID is equal to main-data-source-ID”
    12. OK out of all dialogs, you’re done.

    Note that if your dropdown is inside a repeating section/table, then you will need to manually adjust the value in the formula dialog after step 11 to use the “current()” function so the filter works correctly.

     

  • Microsoft InfoPath 2010

    New MSDN Articles on Digitally Signing Data in InfoPath 2003

    • 0 Comments

    Two new articles have been posted to MSDN about digitally signing data in InfoPath 2003 SP1. The first article, Digitally Signing Data in InfoPath 2003, provides details about how to configure InfoPath forms for digitally signing data, including information about new features added in SP1 for signing specific sets of data within a form. This article also provides an overview of the InfoPath object model and code samples for working with digital signatures. The second article, Verify and Add Digital Signatures to Form Data in InfoPath 2003 Using MSXML 5.0 or .NET Framework Managed Code, provides C# code samples that demonstrate how to verify and add digital signatures to data in InfoPath forms from external applications written using MSXML 5.0 or .NET Framework classes. This article also provides a C# example that demonstrates how to override the Digital Signatures Wizard in InfoPath to fully automate the process of signing data.

    Digitally Signing Data in InfoPath 2003

    Summary: Microsoft Office InfoPath 2003 Service Pack (SP) 1 provides new digital signatures features, as well as additions to the InfoPath object model for working with digital signatures programmatically. For example, you can specify sets of data in the form that can be signed separately. For each set of data that can be signed, you can specify whether to allow a single signature or multiple signatures, and the relationship among signatures. With these capabilities, you can customize the digital signatures feature so you can track the status of valuable data.

    Contents
    Introduction
    Valid Digital Certificates for Signing Data in InfoPath Forms
    Defining Counter-Signatures and Co-Signatures
    Designing InfoPath Forms with Digital Signatures
    Understanding the Digital Signature Status and Verification Process
    The Verify Digital Signature Dialog Box and Nonrepudiation Data
    Using the InfoPath Object Model to Work with Forms Configured for Signing Data
    Code Samples
    Conclusion

    Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/ODC_INFDigitallySigningData1.asp

    Verify and Add Digital Signatures to Form Data in InfoPath 2003 Using MSXML 5.0 or .NET Framework Managed Code

    Contents
    Introduction
    Interoperability Between InfoPath and MSXML 5.0 Object Model
    Interoperability Between InfoPath and .NET Framework Digital Signatures Classes
    Conclusion

    Summary: You can expedite the digital signatures process for your Microsoft Office InfoPath 2003 forms by building external applications that add or verify digital signatures. Find out how to build managed code applications that employ MSXML 5.0 or Microsoft .NET Framework code to verify or add digital signatures to data in InfoPath forms. Learn to set up your InfoPath form templates so they are compatible with MSXML 5.0 and .NET Framework code. Discover how to write custom code in your form templates so that users can add digital signatures without using the Digital Signatures Wizard.

    Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/ODC_INFDigitallySigningData2.asp


     

  • Microsoft InfoPath 2010

    New MSDN Article: Support and Troubleshooting for XML Schemas in InfoPath 2003

    • 0 Comments

    A new article is up on MSDN about working with XML schemas in InfoPath. Although InfoPath 2003 has great support for the W3C XML Schema ("XSD") specification - and even better support with higher performance in SP1 - there are a few constructs that require a little hand-holding. The article also explains in great detail the differences between InfoPath 2003 and InfoPath 2003 SP1 handling of schemas, and some schema constructs that have special meaning to InfoPath.

    Summary: Microsoft Office InfoPath 2003 allows you to create XML form solutions by loading an externally authored XML Schema (XSD) definition file into the InfoPath design environment. Learn how to take advantage of InfoPath support for using externally authored XSD files to create custom form templates, and find out how to troubleshoot common problems.

    Contents
    Introduction
    Unsupported XSD Constructs
    XSD Constructs with Reduced Functionality
    XSD Constructs with Special Meaning in InfoPath
    Debugging Common XSD Errors
    How to Edit or Author an XSD for InfoPath
    Conclusion

    And here's the link:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/ODC_INFInfoPathXSD.asp

  • Microsoft InfoPath 2010

    Using CHM files in InfoPath custom task pane

    • 1 Comments

    CHM files are compiled Microsoft® HTML Help files suited for a wide range but mostly used as help files for applications. You can also use them inside the InfoPath task pane because they are URL accessible. There are many formats for the URLs as described in the link below. One of the formats is:

     

    mk:@MSITStore:<path to CHM file>::<path inside CHM file>

     

    You can enter an absolute path to the CHM file, for instance on a share or on the file system, but you can also include the CHM file as a resource in your form and access it by just using the filename as the path to the CHM file. The path inside the CHM file depends on the CHM file itself.

     

    How to find the link from a CHM file

     

    If you have an existing CHM file, you can easily find the hyperlink to a given page by right-clicking on the page and selecting properties. Note that the URL usually overflows and you can only see two lines, so to get the full URL you must click in the ‘Address (URL)’ field and select all text (Ctrl + A) and then copy-paste the link. For example the link to the first page in the Microsoft Office InfoPath 2003 help file is:

     

    mk:@MSITStore:C:\Program%20Files\Microsoft%20Office\OFFICE11\1033\INFMAIN.CHM::/html/inconIntroInfoPath.htm

     

    Links

     

    INFO: HTML Help URL Protocols

    http://support.microsoft.com/default.aspx?scid=kb;en-us;235226

     

    Microsoft HTML Help 1.4 SDK

    http://msdn.microsoft.com/library/en-us/htmlhelp/html/vsconHH1Start.asp

  • Microsoft InfoPath 2010

    Problems downloading/installing the InfoPath SDK?

    • 1 Comments

    We're getting reports from some users who are having problems installing the InfoPath SDK. The problem appears to be caused by intermittent network traffic issues causing downloads to fail part-way through. You'll end up with a file that appeared to download but is missing some or most of the data. Restarting the download sometimes accesses the incomplete cached version, which doesn't improve the situation.

    The file size of InfoPathSDK.msi downloaded from http://www.microsoft.com/downloads/details.aspx?FamilyId=351F0616-93AA-4FE8-9238-D702F1BFBAB4&displaylang=en should be 4.34 MB (4,552,192 bytes). If you end up with a smaller file it's been truncated due to network problems, and the install will fail. Clear your browser cache (in IE: Tools | Internet Options, Delete Files...) and try the download again.

     

  • Microsoft InfoPath 2010

    Example script for showing Mail Envelope based on User’s Role

    • 1 Comments

    The option to “Submit as Email” doesn’t include the form in the body of the mail, so here’s another way to encourage your form-fillers to send their forms as email and include that body.

    This script could be used in a Blogger form to turn on the Mail Envelope when the user switches to the “Email” view. That event could be triggered by the form-filler using the View menu, or even by a Rule on a button. It also makes some decisions based on the user’s current role so you can see how to do that.

     

    function XDocument::OnSwitchView(eventObj) {

      var mail = XDocument.View.Window.MailEnvelope;

     

      if (XDocument.View.Name == "Email") {

        // get nodes from DOM

        var blog = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:blog");

       

        var id       = blog.selectSingleNode("@ID");

        var title    = blog.selectSingleNode("@Title");

        var blogger  = blog.selectSingleNode("@BloggerName");

        var replies  = blog.selectNodes("d:reply/@ReplyName");

     

        // Set To field to include blog and the original blogger

        mail.To = "blog; " + blogger.text;

     

        // Set CC field to include all the replies (minus the current one)

        if (replies != null) {

          var cc = "";

          for (var i = 0; i < replies.length - 1; i++) {

            cc += replies(i).text + "; ";

          }

          mail.CC = cc;

        }

     

        // Set subject to look like a thread

        var subject = "Blog " + id.text + " - " + title.text;

        if (XDocument.Role != "Create")

          subject = "RE: " + subject;

        mail.Subject = subject;

     

        // Show the mail envelope

        mail.Visible = true;

      }

      else {

          mail.Visible = false;

      }

     

     

  • Microsoft InfoPath 2010

    ActiveX Controls in InfoPath 2003 - in Visual Basic 6.0

    • 1 Comments

    Andrew Ma, a tester on the InfoPath team, has created a Visual Basic 6.0 version of the InfoPath Hands-On Lab for creating custom controls. You can find it here on Andrew's blog:

    http://blogs.msdn.com/ajma/articles/213868.aspx

     

  • Microsoft InfoPath 2010

    The Microsoft Office InfoPath 2003 SDK has been updated for SP1!

    • 2 Comments

    The Microsoft Office InfoPath 2003 Software Development Kit (SDK) contains sample forms, tools, macros, code libraries, and documentation to assist with InfoPath form development in both InfoPath 2003 and InfoPath 2003 SP1.

    Here’s what’s new in the updated SDK

    • New tool: Using the InfoPath to Word Wizard
    • New code library: Build a Custom BizTalk 2004 Pipeline Component
    • New code library: Build a Custom Importer
    • New code library: Using a Custom Script Library for Common Tasks
    • Macros to assist in Visual Studio Development
    • Ability to create installers in multiple languages with the RegForm tool
    • Other improvements and updates to the existing tools
    • 6 new common developer tasks
    • Many SP1 updates to existing content and tools
    • Updated InfoPath Developer’s Reference

    Download the SDK today!  Go to http://www.microsoft.com/office/infopath and look in the Downloads section at the bottom of the page.

  • Microsoft InfoPath 2010

    Are you an InfoPath whiz?

    • 1 Comments

    When it comes to InfoPath, will you squeak by with a passing grade or graduate at the very top of your class? Take a short quiz on Office Online and find out exactly where you stand.

    http://office.microsoft.com/assistance/quiz.aspx?AssetID=QZ010971581033

    If that was too simple, here's the next question for you InfoPath whizzes out there: What questions would you ask to find out if someone knows InfoPath inside and out?

  • Microsoft InfoPath 2010

    Implementing Change Tracking for InfoPath Forms

    • 1 Comments

    Although InfoPath doesn't have a Change Tracking feature built-in like Word and some of the other Office System applications, read on for guidance on how to implement it in your own solutions.

    There are several problems to decide before jumping into implementation: where do you want to store change tracking information, how do you map between list of changes and elements, tracking information protection, and what format you use to store change tracking information.

    Storage options

    Depending on schema of XML there are several options:

    1.  Closed schema - public or required by third party.
      1. "Envelope" approach - you can store whole document as XML sub tree inside your own XML with open schema.
      2. Using Processing Instructions to store data is possible when the schema allows it and consumers of XML can handle processing instructions correctly. Note that even if one suppose to ignore them it is not always the case.
      3. Separate file. Just keep tracking information somewhere (I.e. local file or remote Web service). This approach is remotely reasonable if you know how to associate data with tracking information.
    2. Open schema
      • Store tracking information as single attribute.
      • Store tracking information as sub-tree of each element that is interesting for change tracking
      • Store tracking information in single node providing some mapping between elements you are interested in and tracking information.

    Format options

     1. XML friendly.

    If you want your tracking information to be processed using some form of normal XML handling (XSL, XML readers, XPath navigation) then you should use XML sub-trees to store change tracking information.

    For example:

     <changes>
      <change forElement="element1233" date="2004-06-12" author="john" type="textChange">New text</change>
      <change forElement="element1233" date="2004-06-14" author="fred" type="textChange">Don't writen new text!</change>
     </changes>

     2. Custom text format

     If you can't use normal XML for some reasons (i.e. storage options 1.b, 2.a) then you can develop text format to store the data. You can use approach close to XML (i.e. just store sub-tree as string) or even go with Base64 encoded binary.

    Mapping between element and tracking information

     1. Direct access.

     If you can put tracing information right into element you are interested in then you don't need any mapping.

     Note that this approach requires you to think through deletion scenario because the element itself might be deleted along with it's tracking information.

     2. Element ID. 

    This is an easy option to implement if you have or can establish persistent unique element identifiers for each element you want to track changes. It could be attribute on elements or some combination of attributes and values of element.

    Note that you can not use XPath to element as unique id if you have any repeating content you want to track changes on.

    The problem here is that you need to have good ID and should think through insertion of elements.

    3. Position based mapping.

    This is the most complex option to implement. If you can't have any identifiers for element you had to go with position based mapping. I.e. 

    <change forElement="/root/items[0]/item[4]/component[3]" date="2004-06-12" author="john" type="textChange">New text</change>

    where forElement contains the XPath to the element of interest.

    The main problem here is that you have to dynamically update all mappings on element insertions through the tree.

    Change tracking information protection

    You should consider if and how you want to protect this data. Approaches would vary from digitally signing each change (or editing session) to "who cares if it is changed?"

    Coding ideas for simplest case

    You have unique element IDs that somehow get generated for elements. You are interested in recording changes in text value of an element.

    Here is sample of XML you want to record changes for:

    <root>
     <items>
      <item id = "12"><textToTrack>text</textToTrack></item>
      <item id = "23"><textToTrack>text</textToTrack></item>
      <item id = "55"><textToTrack>text</textToTrack></item>
     </items>
    </root>

    The approach choosen to store the data: separate from the data as subtree of the <root> node, and no protection and tamper detection for tracking information.

    Here is example of XML with tracking information.

    <root>
     <changes>
      <change forElement="12" date="2004-06-12" author="john" type="textChange" ><old>text</old><new>Shining new text</new></change>
      <change forElement="12" date="2004-06-14" author="fred" type="textChange" ><old>Shining new text</old><new>Don't write new text!</new></change>
      <change forElement="23" date="2004-06-14" author="fred" type="delete"></change>
     </changes>
     <items>
      <item id="12"><textToTrack>Don't write new text!</textToTrack></item>
      <item id="55"><textToTrack>text</textToTrack></item>
     </items>
    </root>

    To code this in InfoPath you need:

    Make sure schema allows <changes> to be inserted. I.e. In designer for new solution create this structure in the Data Source task pane.

    Figure out how to get user name if needed.

    Add an "OnAfterChange" listener for <items> node, and implement the following pseudo-code:

     IF change = "add" AND node-name = "item"
      make sure ID is generated for "add"
      record (ID, added) information.
     IF change = "remove" AND node-name = "item"
      record  (ID, deleted)
     IF (change = "add OR change = "remove" OR change = "change") AND node-name = "textToTrack"
      record (ID, textChange, oldValue, newValue)
      

    Where ID is "id" attribute of corresponding "item" node, and record means append all needed information a <changes> collection. Record function should also take care of merging change information for the same date/user like if node was added in this session all changes should be combined into "added" record, rather then creating multiple "changed" sections.

    Note that "undo" user actions will rollback change as well as tracking information. If you store data in separate file you should take care of undo yourself.

     

Page 10 of 12 (298 items) «89101112