update value using function when submitting web enabled form - InfoPath Dev
in

InfoPath Dev

update value using function when submitting web enabled form

Last post 10-05-2010 03:51 PM by KansasCoder. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-05-2010 03:36 AM

    update value using function when submitting web enabled form

    I need to use a function to update the value of a form field wwhen the user submits the form. I cannot. Use code behind so I need to do this in the ssubmit behavior using a function. Is it possible in infopath 2007? Thanks, Newbie
    Love them ALL...regardless.
  • 10-05-2010 01:44 PM In reply to

    Re: update value using function when submitting web enabled form

    Hi KC,

    Well, you can call the function from a rule and change your Submit button to be Rules and Code and just have two rules - one that calls the code function and another that submits. Depending on the function, you may be able to do it without code (just using the XPath macro language which comes with InfoPath). Either way works. To call the code from the first rule, you need to add it to your condition. Here's a link to an old post by Greg that shows how to use xdExtension to call code. Your code would then set the value and return true or false. The rule doesn't have to have an action or you can combine it with the submit and make the action submit to the data connection. Most times you don't need code since xpath is so rich, so I encourage you to explore that as your first option (just using the set value rule action with xpath functions on fields to calculate the value that you want to set)

    Patrick Halstead
    Project Manager at Qdabra
  • 10-05-2010 03:51 PM In reply to

    Re: update value using function when submitting web enabled form

     Hi Patrick,

    Thank you for your reply. I'm new to InfoPath (but not development) and would like to know if there is a good resource for the XPAth macro language? My undesrtanding is that InfoPath 2007 uses version XPath 1.0. is that correct?

    The link you were going to pass on didn't make it into the post. Would you mind reposting that?

     The problem I was having when tying it to a submit button and using a rule was that I wasn't able to debug the process so I wasn't sure if the failure to submit was happening when I attempted to retrieve the max(@ID) field and concatenate it to the julian date that was already in there as a default OR if the error was happening when I attempted to name the file..which come to think of it I don't recall explicitly naming the file to be saved when using the button code. I'm going to have to figure out the debug process on this product pretty quick or my learning curve will be grueling!!

    Thank you!

    Love them ALL...regardless.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.