Problem:
I created an infopath form, which works perfectly, exactly once after publishing it to SharePoint. What hapens?
The first time after publishing the form, the value that I get from a sharepoint list, is entered perfectly. Then I fill out the form, submit it, works like a charm.
Then I create a new form, but that value that I should get from a sharepoint list, is no longer entered.
Now, I re-publish the form, and it works fine again. Once.
While testing in Infopath, this works as it should, every single time. There are currently no workflows attached, the value in the list that I have to look up, is still in the list.
What does my form do?
· Get the Active Directory name, put it as a default in a Name-field.
o UserProfileService -> GetUserByName, Value[Name = "AccountName"]
· Rules Name-field
o Set saldo in hidden field
o Set saldo in visible field
Both these saldi use the same formula, and get their data from a SharePoint list. This is actually the value that is loaded only once and should be loaded every time!.
· User enters start and enddate and now has to click a "calculate" button.
o Calculate the number of work-days between the 2 given dates using Excel:
· Query dataconnection: OpenWorkbook
· Submit using dataconnection: setstartdate (set the startdate in the excel file)
· Submit using dataconnection: setenddate (set the enddate in the excel file)
· Set field value: sessionId = OpenWorkbookResult
· Set field value: sheetName = sheetName (name of the worksheet)
· Set field value: rangeName = rangeNameDateDiff (set where to get our data from)
· Query using dataconnection: GetDateDiff (get the actual difference between the 2 dates)
· Submit using data connection: CloseWorkbook
o In the field where the calculated number of days has to appear, I've put "GetCellA1Result" in the default value.
o After excel is closed, I calculate the user's new saldo: number in hidden field - "excel-number" = new saldo and overwrite the old saldo with this new one.