Help Needed converting Jscript to C# - InfoPath Dev
in

InfoPath Dev

Help Needed converting Jscript to C#

Last post 10-21-2010 12:00 AM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-20-2010 03:10 AM

    Help Needed converting Jscript to C#

    I have a form that was designed in Infopath 2007.

    The form use’s Jscript and works fine but we are upgrading MS Office to 2010

    And MS have now taken the Jscript functionality out of IP2010 the from will not run.

    So I need to convert the Jscript to C#.

    But I’m not a programmer  so I am finding it difficult.  The script is

    // ****************************Code to change the sql Query for Face Days*********************************

    var FaceDaysSQL = "";

    var FaceDaysSQL1 ="";

     // Retrieve the SQL statement of the data source

     var FaceDaysSQL = XDocument.DataObjects["Face days"].QueryAdapter.Command;

     //Retrieve the field in the InfoPath form whose value will be used in the WHERE clause

    var FaceDays =XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Face/@FaceDate");

    // Generate the new SQL statement with WHERE clause

     FaceDaysSQL1 = FaceDaysSQL + " and FaceDate = '" + FaceDays.text + "'";

     // Populate the command with the new SQL statement

     XDocument.DataObjects["Face days"].QueryAdapter.Command = FaceDaysSQL1;

    // Run the query

    XDocument.DataObjects["Face days"].Query();

     // change the Query back to orriganl query.

     XDocument.DataObjects["Face days"].QueryAdapter.Command = FaceDaysSQL;

     

    any help would be appreciated

  • 10-21-2010 12:00 AM In reply to

    Re: Help Needed converting Jscript to C#

    Hi Pricey4,

    This isn't much code to convert but we're pretty busy here trying to pay the bills. If you want to throw us a bone and donate $47 to the InfoPathDev cause, we'll do it tomorrow. Go to Qdabra dot com's support page and PayPal us $47 and we'll do it tomorrow. If you think this is too "Pricey" 4 U, then I totally understand and hope that someone else with more time replies here for free ...

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.