I am trying to: Need a unique dynamic serialized reference number per submission that can be parsed in the resulting template view not the post ID. We use this number to track all submissions and subsequently tie parent/child relationships. I don't understand how the suggested solution in the URL below will achieve this. Please break this down so I can quickly implement reference numbers. Thanks.
I visited this URL: https://toolset.com/forums/topic/assigning-a-serial-number-to-a-cred-form-submission/
I expected to see: N/A
Instead, I got: N/A
I also checked this post out. Does it still hold true that Toolset can't do this? What is the best practice? https://toolset.com/forums/topic/serial-number-field/
Dear Jan,
Yes, it is true that there isn't such a feature within Toolset plugin(both CRED plugin and Types plugin), as the thread you mentioned above it needs custom PHP codes, and both threads should be able to work:
1) https://toolset.com/forums/topic/assigning-a-serial-number-to-a-cred-form-submission/#post-211712
This thread is using CRED action "cred_save_data", which works only when user create the post with the specific CRED form, so it will not be able to work when you create the custom post in wordpress admin side.
2) https://toolset.com/forums/topic/serial-number-field/
This thread is using wordpress built-in action hook wp_insert_post, which works in CRED form or in admin side
https://codex.wordpress.org/Plugin_API/Action_Reference/wp_insert_post
The wp_insert_post action fires once a post has been saved. You have the ability to set it to only fire on new posts or on all save actions using the parameters