OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

This topic contains 6 replies, has 3 voices, and was last updated by  Ivan Klymenko 7 years ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #34901

    Jowo
    Participant

    In the GUI. I created a custom entity with multiple fields, integers, currency, strings etc.

    Then I created another and now I want to add relation between them, I choose “Relation many to one”, select my previous custom entity System:TestEntity and in target field I only get the “string” fields …?

    Why can’t I create a relation on an integer?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #34902

    Dima Soroka
    Keymaster

    Relation will be created on entity primary key, in relation configuration you are defining a related entity field that will be used for value selection in dropdown and it is limited to string for now.

    Please let us know more about your use case for integer value.

    #34903

    Jowo
    Participant

    Keep in mind we are talking about the GUI here.

    I am trying to do a simple relation between two tables.

    Example:

    – Order
    – Order rows

    And then connect multiple order rows to an order. Usually this is done on an ID column.

    #34904

    Dima Soroka
    Keymaster

    This is exactly how it works, relation created on id column. In the UI we allowing to define a text column that will be used for relation selection. Example: order and order status. Relation will use status id for foreign key and status label for selection. On the UI side you selecting only field for text label.

    #34905

    Jowo
    Participant

    But looking at the Magento bundle your “Order id” is type string. This is what I mean, it should be integer (in our case). I don’t understand why there is a limit on the data type for relationships?

    This is the schema:

    View post on imgur.com

    Transaction.settlement_id in transactions is connected to Settlement.id

    Instead of this I need to create a string type field to connect them?

    #34906

    Dima Soroka
    Keymaster

    Right now yes if you are using custom entity from the UI, but we got your case and will plan to adjust limitations on our end.

    #34907

    Ivan Klymenko
    Spectator

    Hi Jowo,
    possibility to use integer field as target field was implemented. Thank you for sharing the use cases!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Custom entity relations’ is closed to new replies.

Back to top

You will be redirected to [title]. Would you like to continue?

Yes No

You will be redirected to [title]. Would you like to continue?

Yes No