field doesnt updates with webservice data connecti - InfoPath Dev
in

InfoPath Dev

field doesnt updates with webservice data connecti

Last post 07-03-2006 02:00 AM by loma. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-30-2006 10:44 AM

    • loma
    • Not Ranked
    • Joined on 06-26-2006
    • Posts 5

    field doesnt updates with webservice data connecti

    Hi!

    In my form i have a field whose default value is retrieved from a webservice. The problem is that the data from the web service is just retrieved the first time when the user creates a new form. I want it to be updated every time the form is opened and has therefor checked the "update from dataconnection every time form is opened"-box when i created the data connection to the webservice. Does anyone know why the field doesnt get updated?
  • 06-30-2006 11:26 AM In reply to

    Re: field doesnt updates with webservice data connecti

    If the field is "bound" to the secondary data source (the web service dom) then the field should update. If, however, the field is bound to the main dom, then that is why its not being updated.
  • 07-03-2006 02:00 AM In reply to

    • loma
    • Not Ranked
    • Joined on 06-26-2006
    • Posts 5

    Re: field doesnt updates with webservice data connecti

    Yes, the problem was that the field was bound to the main datasource. Thanks a lot for your help!!

    Now i headed an new problem, how can i change the value in that field after i have changed the binding? My code for this is:

    XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:tns="http://strandinoment.com/webservices/" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"');

    var currentUserDep = XDocument.DOM.selectSingleNode("//dfs:dataFields//tns:GetMyInfoResponse//GetMyInfoResult");

    var myDep = currentUserDep.text;
    if(currentUserDep.text.charAt(0) == '<'){
    var string = currentUserDep.text;
    var start = string.indexOf("Department",0);
    var end = string.indexOf("]",start+21);
    myDep = string.substring(start+21,end);
    }
    else myDep = currentUserDep.text;
    currentUserDep.text = myDep;

    But i get the error "Object required". It seems that the code can not find the right node. Is that right? How do i solve this?
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.