Hi - I'm thinking of creating a basic Customer Relationship Manager using the post relationship function in Types. However, upon playing around briefly, I've hit a couple of walls.
I have two post types, Person and Organisation. The problem is that I can only assign one Organisation to a person (if Organisation if the Parent and Person is the Child), or I'd have to create new Organisation posts if Person is the Parent.
Is it it possible to achieve what I'm after with post relationships, or would I need to go down the taxonomy route (exclusively or in tandem)?
Thanks. Gavin.
Dear Gavin,
I understand that a single person can belong to several organizations and each organizations has several persons. This is what we usually call a many-to-many relationship.
If this is what you want, you need an intermediary post type to hold the relationships. This is better explained over here:
https://toolset.com/faq/how-do-i-associate-one-child-with-several-parents-of-the-same-type/
Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
Regards,
Caridad
Thanks Caridad - I think I'm beginning to get to grips with many-to-many relationships.
I'd like to keep this open while I test it out a bit more and also the CRED (particularly the new beta) element too, if that's okay. If not, close it and I'll post another thread if required.
If it remains open, I'll resolve it in a few days if all is okay.
Thanks. Gavin.
Dear Gavin,
I will leave this open waiting for your reply.
Regards
Caridad
Hi Caridad - I've tried out the beta of Types and CRED and have a few issues to clear up.
I have three CPTs - People, Organisations and Client Records, the latter of which is the intermediary CPT. However, upon creating the CRED form to add content for each of these, the only form to have the parent select option is the Client Records, and even then, there is no option to add a new organisation or person on the fly, instead I'd have to first create a new person, then perhaps a new organisation and then create an entry via the client records form from which I can select the parents I've just created.
Another problem I see is that I can only select one parent, not multiple.
Is the solution to this to create the intermediary as a taxonomy, or am I missing something crucial (and maybe obvious 🙂 )
Thanks. Gavin.
Dear Gavin,
One CRED form is normally used to create one post. There is a one to one relationship.
You can add generic fields in your CRED form and save the data in new posts by using the 'cred_save_data' hook:
https://toolset.com/documentation/user-guides/cred-api/#csd
Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
Regards,
Caridad