Skip Navigation

[Resolved] Incremental Serial Numbers per Submission with CRED

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by Luo Yang 4 years, 5 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#516739

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

#516740

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/

#516819

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

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