Getting Error in Infopath Code RRS feed

  • Question

  • Hi All,

    I am new to InfoPath coding and I have been given a existing InfoPath form to edit which has C# coding in it.

    I am getting Object reference error in the below line. I am not able to understand what exactly the issue is. Could someone assist me here?

     DataSources["ExtRemediatedActions"].CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:queryFields/q:SharePointListItem_RW/q:Title", NamespaceManager).SetValue(incidentId);

    Regards, Shreyas R S

    Monday, May 9, 2016 12:35 PM


  • Hi Shreyas R S,

    Code Explanation :

    Actually you have one External Data Source called "ExtRemediatedActions",in that data source there is a field called "Title".This "Title" field value as been set through VSTA code.So,the value of the external data source("Title") has been set as "incidentId".

    To trouble the error follow below procedure.

    1.First Check your external data source("ExtRemediatedActions") exist in your infopath form.

    2.If the data source is present,Check whether the field name called "Title" Existed or not.

    More over "/dfs:myFields/dfs:queryFields/q:SharePointListItem_RW/q:Title" from this line,we can get title value and how your setting the value?.So that might be the reason your getting "Object reference error". 
    • Edited by Dillibabub Monday, May 9, 2016 2:42 PM
    • Proposed as answer by Dean_Wang Sunday, May 15, 2016 7:02 AM
    • Marked as answer by Dean_Wang Wednesday, May 18, 2016 8:53 AM
    Monday, May 9, 2016 2:31 PM