2012年3月6日 下午 10:57
I had setup some infopath forms on MOSS 2007 and we upgraded to sharepoint 2010 and the forms continued to work but were opening in the infopath client instead of in the browser.
When designing the form template in infopath 2010 an error said that the dataconnections needed to be upgraded for the form to be browser compatible
I upgraded the dataconnections and quick published the form
the autonumber field is now broken and says NaN for all new forms
I have found that the way that the dataconnection references the library is different
in 2007 the formula max(@ID) + 1 was represented as:
xdMath:Max(xdXDocument:GetDOM("RetrieveID")/dfs:myFields/dfs:dataFields/dfs:Requisition_Form_Library/@ID) + 1
and in 2010 the formula is now max(ID) + 1 and is represented as: (note their is no @ now)
xdMath:Max(xdXDocument:GetDOM("RetrieveID")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:ID) + 1
I have deleted the dataconnection and recreated it but still get the same problem, the max(id) + 1 results in NaN
2012年3月6日 下午 11:02
until i get an answer, I have restored the form back to how it was
so it has the original infopath 2007 dataconnections which are not compatible with browser enabled forms
the form is working fine now but opens in the infopath client which we do not want
how can i make these new dataconnections work?
2012年3月6日 下午 11:12Is it because there is not previous number to return? So it returns NaN?..
2012年3月6日 下午 11:16
Have you considered of opening these data connection files and modifying them manually? These data connections files are just in TXT format.
2012年3月7日 上午 01:08There are about 200 forms in the library allready. I have used max(ID) and max(BIN), BIN is the where we store the number and use to set the filename. Neither of these fields will work.
2012年3月7日 上午 01:10
I am not using data conection files.
I am using data conections configured in the infopath form template. they are specific to this template so did not think it appropriate to save each connection as a file as they will not be used elsewhere.
2012年3月7日 上午 01:56
ran some tests on my test server with a brand new info path form
setup a new site, setup a new infopath form, published to a new form library
setup a dataconnection to the form library to receive ID
put a field and a button on the form, the button sets the value of field to max(ID)+1 where ID comes from the receive connector
then the button saves the file in the library with the file name in the field
this method always results in NaN even if there are documents in the library allready, so max(ID)+1 would not be nothing
i changed it to count(ID) which results in 0 no matter how many docs there are
so i changed it to count(ID)+1 which always results in 1 no matter how many docs there are
why are my data connections not receiving the information? going from the count result they are receiving 0 IDs even though there are some in there
2012年3月7日 上午 02:37
create a debugging section and drag the ID from your secondary datasource onto it for testing purposes.
I suspect... you haven't query the datasource. So it's empty.
did you tick the box to query for data on form open?
jliu - http://johnliu.net - http://sharepointgurus.net
2012年3月7日 上午 03:03
yup you are bang on the money.
the box query for data on open is deliberately unticked as the data may change while the user is filling the form in and over write someone elses form
i have added to button rules query for data at step 1 and it is working fine
I have also opened the original template and the query for data rules were there, I can confirm that they are automatically deleted when you upgrade the rules and need to be recreated.
- 已標示為解答 Brendon Pilott 2012年3月7日 上午 03:03