Link to home
Start Free TrialLog in
Avatar of William C Johnson
William C JohnsonFlag for United States of America

asked on

Generate an ID Number

When using MS InfoPath 2010 to enter data into a SharePoint database, I want to be able to display in the InfoPath form in a field called SBSR#, the text "SBSR" plus the next available ID number from the SharePoint database ID field.  How can I make that happen?  What formula will make that happen in the InfoPath Text Box Properties dialog box?  Everything I've tried so far produces NaN because the item hasn't been written to the SharePoint database yet.

I appreciate any ideas.

Bill
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of infoalex
infoalex

You need to use the "Max" function to get the current maximum ID and add 1  within InfoPath. For this you can create the SharePoint hosted WCF service, create new data source within InfoPath pointing at this service and add calculated field to the InfoPath form (select new data source)
Avatar of William C Johnson

ASKER

I'll give that a try.  Thanks for the feedback.