Invoking C# Method in Managed Code from an InfoPath Rule - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Invoking C# Method in Managed Code from an InfoPath Rule

Last post 07-08-2011 02:16 PM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-08-2011 11:04 AM

    Invoking C# Method in Managed Code from an InfoPath Rule

    Forum Community,

     

    I would like to attach a method I created using C# such that when a condition in an InfoPath rule is met, the method in my managed code is automatically invoked. I found a tutorial that explains something close to what I want to accomplish; however, it appears the method attached to the rule can only return a boolean value of "true". See below link:

     http://www.infopathdev.com/blogs/greg/archive/2004/09/15/Use-Code-to-Determine-a-Rule-Condition.aspx


    Thanks in advance for your help.

     

    ~W

  • 07-08-2011 12:42 PM In reply to

    Re: Invoking C# Method in Managed Code from an InfoPath Rule

    Hi W,

    Yep, Greg's right, but how about a workaround? Have your code set a field in the main data source or a secondary one and then check that.

    :)

    Patrick Halstead
    Project Manager at Qdabra
  • 07-08-2011 12:56 PM In reply to

    Re: Invoking C# Method in Managed Code from an InfoPath Rule

     Hi Patrick,

     

    Thanks for the quick reply. 

     

    I'm using InfoPath 2010, and I noticed "Show A Dialog Box Message" is not an available among the drop-down list items after selecting "Add Action". I'm only able to go so far as item #7, under "Create the rule condition". It appears Greg is using an earlier version of InfoPath. Do you know why displaying a dialog box message is not present?

     

    Thanks,

     

    ~W

  • 07-08-2011 01:57 PM In reply to

    Re: Invoking C# Method in Managed Code from an InfoPath Rule

     Forum Community,

     

    I found a article from Microsoft that further discusses how to invoke managed code from a rule; see below link:

     http://blogs.msdn.com/b/infopath/archive/2005/06/17/430347.aspx

     

    Am I correct in assuming the code for my method (i.e. Test(string param)) belongs in the file named "FormCode.cs"?

     

    Thanks,

     

    ~W

  • 07-08-2011 02:16 PM In reply to

    Re: Invoking C# Method in Managed Code from an InfoPath Rule

    If your form is a browser form, the display a dialog box message action won't be present. And in IP 2010, I think it says something like "Display the results of a field or a formula"....

    Hilary Stoupa

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.