Tell us what you are trying to do?
I want to create a unique field will be auto-generated that uniquely identifies a post in products post type.In my example I have two post types,an establishment and a product.I created have a one to many post relationahip where by an establishment can have many products. I Want to use the post title of the establishemt(parent) and combine it with another value(may be post_id of products post type) to create a new unique value that will be used as the post title for products post type.
Hello and thank you for contacting Toolset support.
You can use the toolset_association_created hook and update the product post title. The action will provide the IDs of both posts(establishment and product) so you can get the title of the establishment and update the title of the product.
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_association_created
I hope this helps. Let me know if you have any questions.
please Elaborate further how I'm am going to use the toolset_association_created in the back-end and front-end forms?
Well, custom code can be added on the theme's functions.php file, on a separate plugin, or in a Toolset custom code snippet. Check the following articles:
- https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/
- https://toolset.com/documentation/programmer-reference/adding-custom-code/
- https://toolset.com/documentation/programmer-reference/adding-custom-code/how-to-use-toolset-api-hooks-in-custom-code/
I assume that you are not familiar with programming, right? If yes, I'll help you with this task. I'll need more details on how you are adding Establishments and Products. Are you using the backend? Or are you using Toolset Forms? Would you allow me temporary access to check this closely? Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **