PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

ENTRY ID's - Dynamically Populated, with a prefix as a PO Number?

  1. Gil Namur
    Member

    Hello!

    Please don't shoot me if this has been covered but I searched and searched and can not find this.

    To generate a PO Number, I have been using the code that David Smith provided here which works great!: http://www.gravityhelp.com/forums/topic/guid-entry-id

    Now I have a client that needs multiple forms. I saw David's notes on this but I also read in the forums that ENTRY ID's are unique across all forms.

    So I was wondering!

    Form 1 - for Blue Widgets orders
    Hidden field - Allow field to be populated dynamically -
    BW(Entry ID)

    example: PO becomes: BW76

    Form 2 - for Red Widgets orders
    Hidden field - Allow field to be populated dynamically -
    RW(Entry ID)

    example: PO becomes: RW77

    Can that be done (shortcodes or hooks) without adding PHP to the functions.php file?

    If so, what parameter name do I enter into the hidden field?

    Also, if I just wanted the ENTRY ID with no prefix (BW / RW) what is the parameter name?

    Thanks so much!
    Cheers,
    Gil
    P.S. A PO Number Field ... would REALLY be a great feature to add. Just sayin ;-)

    Posted 11 years ago on Monday February 11, 2013 | Permalink
  2. Without adding code to functions.php - no. You need to calculate this PO number using the code as shown by David Smith.

    The form ID is already stored in the entry as the Entry ID. If you want to store the entry ID in another field called PO, you would still need code added to functions.php since the entry ID is not available until after the entry is made.

    What you could do, is have one generic function to combine the entry ID with a hidden field in your form, which would be populated with the BW or RW, as needed for the form. If you want to do that, create a hidden text field in the form, and then give it a parameter name (the name does not matter. Call it 'widgetcode' or something.)

    Then, in your shortcode, set the parameter name like this:

    [php]
    [gravityforms id=1 field_values='widgetcode=BW']

    That would pre-populate the hidden field with the parameter name "widgetcode" with the value of "BW". Then, in your function, combine this hidden field always, with the entry ID, and store that as the PO.

    Posted 11 years ago on Tuesday February 12, 2013 | Permalink
  3. Gil Namur
    Member

    Hi Chris,

    Thank you for taking the time to spell this out. As PHP is not my forte, I will pass this on to a coder I know.

    I know I said it in my P.S., but I will say it again here. A PO field would be a very very useful feature. You know I love Gravity Forms and will continue to update my license yearly. You offer a great product, a great forum and great value. Just suggesting what I think would add even more value and 'flexibility' to an already great product :-)
    Cheers,
    Gil

    Posted 11 years ago on Tuesday February 12, 2013 | Permalink
  4. Thanks again Gil for your thoughtful comments. I'll bring it up with the team.

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink
  5. Gil Namur
    Member

    Thanks Chris :-)

    In the meantime I am trying this code from member "drawonline"
    http://www.gravityhelp.com/forums/topic/unique-reference-number-for-submissions
    ALMOST works. I left a question there :-)
    Have a great week!
    Cheers,
    Gil

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink
  6. We'll carry on the conversation there Gil. Thank you.

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink

This topic has been resolved and has been closed to new replies.