开发者

InfoPath 2010 NaN

I have been trying to update a text field in a form that will automatically generate a new number in a read only state when a user fills out the form. When the user completes the form and selects the submit button, the form will be attached to SharePoint List and the following user will open the form and the number field will be the number +1. I have used 'count(myn开发者_JAVA技巧umber)' and the field returns 1, but when I close the form and re-open it, the field still displays 1 and never increases. When I use 'count(mynumber) + 1' the field returns 2 and also never updates. Finally, I used 'max(mynumber) +1' and it returns NaN. I have come to the conclusion that there is an array here, but don't know what I need to do, to fix this.

I have informed my manager of 'InfoPath 2010 Cookbook' so hopefully this will help, but I also took a gander as this following link, which was not easy to follow as I believe its for 2007 instead of 2010.

http://claytoncobb.wordpress.com/2009/06/15/auto-numbering-infopath-forms/

I am using SP 2010.


So, here is the simple approach to the simple request:

•Just like in any database, every item in every list and library in SharePoint has a unique ID. This ID is stored in the ID field, which is available for viewing in any list or library. Go to your list, modify the view, and check the box next to the ID field so you can see what I mean. This ID is 100% guaranteed to be unique and is never duplicated. •Since you already have purchase order numbers, you can't use the IDs by themselves, however, you can use them to drive your auto-generated Service Order numbers •The easy method for doing this is to utilize your SO field, which is now a Number field, and determine the differential between the next ID in the list and the next Service Order number that needs to be created. •Then, create a simple workflow in SharePoint Designer 2010 that ONLY runs on the creation of a new item (only runs once per item/form), and set it to add the differential to the current item's ID (Something like Do Calculation: ID + 1200) . Next, use Set Field in Current Item to set your SO field to the variable created by the Do Calculation step From then on, you will always have a GUARANTEED unique, auto-incremented SO # for each form, and you should make this field read-only inside the form so that users can only view it and not edit it.

--Clayton Cobb

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜