Need a simple rule change - Static Text plus Incremental Number - InfoPath Dev
in

InfoPath Dev

Need a simple rule change - Static Text plus Incremental Number

Last post 10-17-2011 11:46 AM by Hilary Stoupa. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 10-17-2011 08:28 AM

    Need a simple rule change - Static Text plus Incremental Number

    I've taken over for someone that has created very nice forms at our business. I'm new and learning. I need to edit one of the existing rules. At present it reads, "concat(substring(today(), 3, 2), difference, "-", max(@ID) + 1)" What I understand it does is takes the date and adds a number from an existing sharepoint list, thus making the final result something like 11-005, 11-006, 11-007 and so on for each form posted.

    The enduser wants me to remove the date and replace with a static text entry like ABC - 001, ABC - 002, ABC - 003 and so on. The incrementatl ID number should remain. Being new to the rules coding, how should this be written?  

  • 10-17-2011 08:33 AM In reply to

    Re: Need a simple rule change - Static Text plus Incremental Number

    I'm not sure what "difference" is in your formula - is it a field in your form?

    At any rate, something like this:

    concat("ABC - ", max(@ID) + 1)

    Should work, being certain to pick the ID field using the "Insert Field or Group button in the formula editor.

    Hilary Stoupa

  • 10-17-2011 10:57 AM In reply to

    Re: Need a simple rule change - Static Text plus Incremental Number

    Thank you for your help. I'm very close. I plugged in your suggestion above and when I submit the form, I now get "concat("ABC - ", max(@ID) + 1)" displayed instead of "ABC - 001." Got to be something simple I'm missing.   

  • 10-17-2011 11:07 AM In reply to

    Re: Need a simple rule change - Static Text plus Incremental Number

    You need to press the fx button and use the formula editor.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-17-2011 11:20 AM In reply to

    Re: Need a simple rule change - Static Text plus Incremental Number

    I tried that however, it refuses to accept the (@ID) part... yet the original code works great. Not sure how to get around that. AND huge apologies. I know these are elementary questions for all of you and I'm sure more than one are thinking, "Geesh.. go take a class or buy a book.." I will... was just hoping this was going to be very simple.

     

    So, if you take the suggested code and type it in, why is it failing to accept it? I'm using the Concat entry." concat(double click to insert field, double click to insert field, double click to insert field)"

  • 10-17-2011 11:27 AM In reply to

    Re: Need a simple rule change - Static Text plus Incremental Number

    Did you use the Select a field... button to select the ID field?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-17-2011 11:29 AM In reply to

    Re: Need a simple rule change - Static Text plus Incremental Number

    Just found that option and trying it now. Bet that's it. (Sucks to be a rookie) Thanks for your patience.  

  • 10-17-2011 11:33 AM In reply to

    Re: Need a simple rule change - Static Text plus Incremental Number

    That was it. Working great now!!! Thanks all for your assistance. Off to the book store. Any suggestions for a good book, training DVD...?

  • 10-17-2011 11:46 AM In reply to

    Re: Need a simple rule change - Static Text plus Incremental Number

    You can get really far using the Office Online stuff - not sure what version of IP you are using, but here's the main page: http://office.microsoft.com/en-us/infopath-help/?CTT=97

    Hilary Stoupa

Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.