Tell us what you are trying to do?
I am using Ultimate Member plugin for user registration (there I extended user profiles and created roles that dictate access to pages and the page contents).
I would like to build a CPT in Toolset:
Project - subset of fields:
projectName
projectDescription etc
REPEATED FIELD
projectParticipant = username (this is a registered user)
projectParticipantRole
a/ When a manager registers a new project, I need to validate the entry form field "projectParticipant", "projectParticipantRole" i.e. access their user profile and store this correctly with my CPT.
Trivial example: instead of registering a non-existing "Jon Smithss" that manager obtains immediate correction e.g. "John Smith"
b/ This has two consequences that significantly help:
1/ I could display in the Toolset View CPT "My Projects" on a simple condition: if current user == project participant than display projectName
2/ I can obtain the list of valid project's participants and then send them in an API to another application to automate actions there.
Is there any documentation that you are following?
forums, your doc
Is there a similar example that we can see?
help me to find it please
What is the link to your site?
hidden link
Thank you for your help
Peter
1. There's no inbuilt Field in Toolset to list all Users, which is what you probably would need here, so the person who fills that form can simply check several users instead of adding complex code that verifies if a eventually (manually?) added username exists.
You could, however, create a Custom Field of this kind, using some PHP code and Toolset API.
That would then avoid having to create any form of validation and failure response logic.
https://toolset.com/forums/topic/i-want-to-add-a-dropdown-with-a-list-of-all-members-with-a-certain-role/#post-328866 is an example of how you can do this.
2. Another solution is to use Post Relationships. In this case, however, each potential user is not reflected in a Field but in a Post.
This post then gets connected to a Project, where one project can have at least many users.
Note, if your users are in many projects as well then you'd need a many to many relationships and in this case, a Relationship Form. In this case, you can not apply any form of API to the form because those forms have no hooks (yet)
My issue is resolved now. Thank you!