Support

Account

Home Forums Feedback Building relations with ID

Solving

Building relations with ID

  • Hi there,

    Just start with WP and ACF and coming from .NET and SQL before.

    Can I with ACF build relations with a unique ID like field name CustomerID and use it in all custom field groups and have a relation between them? I think I missing that in ACF.

    If I create a field group (Suppliers) and have some fields here and also CustomID too, I then create a new field group (Rooms) and wish to related them with CustomID and then I create a third group (Facilities). All groups should be related with CustomID.

    If I then add data to Rooms and add it as a Post Object to Suppliers then the Rooms should appear here auto, but they don’t do that now. I need to add them from Suppliers in the field Rooms.

    I think this should be a great feature when you need to customize wp with own groups (tables).

    /Thanks, Micke

  • WP probably works a lot different that what you are used to. In your example, suppliers, rooms and facilities should probably all be Custom Post Types. You should take a look at this https://codex.wordpress.org/Post_Types.

    ACF is for managing custom data on posts and in other locations and not really for creating complex “things” or “objects”. In WP you can have multiple post types and then relate the posts to each other in the manner you are looking for.

    ACF is basically a tool that does what anyone can do with custom fields in WP, it is just designed to make that job easier to that we don’t need to create all the admin forms ourselves, which is that hardest part of the job in WP.

  • Hi John,

    Yes they are Custom Post Types already and I have set up a custom field for users with a static unique id. That id I reuse in the other custom post types so if the wp or acf could have some relations with numbers I think it should work all the way.

    Okay, I thought acf have build it better and more complex but the engine is wp. Good to know 🙂

    /Thanks, Micke

  • How do you know what user (supplier) is adding a post? Do they select this or is it dynamically generated?

    If you user is logged in, couldn’t you use the user_id? If a supplier has multiple users, are do you associate a logged in user with a supplier?

    Do you set up the supplier post? You could have a “user” type field where you select the users that are associated with the supplier. Then you can query the supplier posts based on the user that is currently logged in it get the supplier ID (which will have a unique Post ID). Then you can add the supplier POST ID to rooms and facilities posts when they are created. This could be a field in ACF, or it could be a custom field that is not part of ACF because it’s only used to tie things together.

    ACF field groups are have unique ID values. What doe not have unique ID’s are the custom fields themselves. But there are plenty of unique ID’s floating around in WP.

  • I already have unique id’s from other system so they need to be there. That’s why I use custom field on the user. The ID are on all custom types like facilities and rooms and supplier.
    I have a solution, but I ask if you got some functionality in your relationship for numbers or guId in custom fields?

  • I’m not the developer, I just help out here, but I do know a lot about ACF and WP. There isn’t anything in ACF that will do what you’re looking for. I understand that you’re probably trying to bring everything over from some other system into WP, but that generally does not work. Like any CMS, WP will require reworking or rebuilding to conform to the way WP works. ACF only works within the system provided by WP.

    Sorry I couldn’t help you more

  • I have already import all data into wp in custom types. Works great, but a real guId relation would be nice so I will take my question to the wp guys 🙂

    Thanks for the answers!

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Building relations with ID’ is closed to new replies.