Wednesday, January 11, 2012

How to check if there is any record in the data source for infopath rule

While develpoing InfoPath 2007 form there was a requirement to reset naming of forms at the change of year i.e. - eg. 12-01

Now we can do this by using couple of fields and get maximum no from data submitted document library. But issue is when we need to create a very first form into that published document library.

So while getting the maximum no we need to check if there is any record in document Library or not. If not then start by 1

Solution is to have a field in the document library to save the form no and get get max form no when new form loads and save into another field.

If max form no is blank then reset it from 1 else increment the no.

No comments: