Announcement

Collapse
No announcement yet.

Same entitySame entity relationship

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Same entitySame entity relationship

    I want to associate and select the same entity. I can do this for a different entity, but how can I do it for the same entity?

  • #2
    The same,as with other entity. Try in Entity Manager. The names in relationship has to be unique

    Comment


    • #3
      Fields

      "careerGroup": {
      "type": "link",
      "tooltip": true,
      "required": true,
      "view": "career:views/career-groups/fields/career"
      },
      "prevCareerStep": {
      "type": "link",
      "tooltip": true,
      "required": true,
      "view": "career:views/career-steps/fields/career"
      },
      "nextCareerStep": {
      "type": "link",
      "tooltip": true,
      "required": true,
      "view": "career:views/career-steps/fields/career"
      },

      Relations

      "careerGroup": {
      "type": "belongsTo",
      "entity": "CareerGroups"
      },
      "prevCareerStep": {
      "type": "belongsTo",
      "entity": "CareerSteps"
      },
      "nextCareerStep": {
      "type": "belongsTo",
      "entity": "CareerSteps"
      },

      just careerGroup worked.
      example relation photo is attached.
      Attached Files

      Comment


      • #4
        on the layout prevCareerSteps. You don't have such field

        Comment


        • #5
          Layout

          [
          {
          "label": "",
          "rows": [
          [
          {
          "name": "name"
          },
          {
          "name": "careerGroup"
          }
          ],
          [
          {
          "name": "prevCareerSteps"
          },
          {
          "name": "nextCareerSteps"
          }
          ],
          [
          {
          "name": "paymentPeriod"
          }
          ]
          ]
          }
          ]

          There is.

          Comment


          • #6
            Originally posted by gundogduyakici View Post
            Fields

            "careerGroup": {
            "type": "link",
            "tooltip": true,
            "required": true,
            "view": "career:views/career-groups/fields/career"
            },
            "prevCareerStep": {
            "type": "link",
            "tooltip": true,
            "required": true,
            "view": "career:views/career-steps/fields/career"
            },
            "nextCareerStep": {
            "type": "link",
            "tooltip": true,
            "required": true,
            "view": "career:views/career-steps/fields/career"
            },
            no, you didn't define them in entityDfes.... prevCareerStep != prevCareerSteps

            Comment


            • #7
              Yes, I am saying that. I'm not trying to show relationships in the same entity. Assets in the same beings. Like career groups. You know what I mean? tanya


              prevCareerStep == CareerSteps
              nextCareerStep == CareerSteps

              Comment


              • #8
                What I tried to say you - in entityDefs you defined the field prevCareerStep, on the layout you added prevCareerSteps (s letter in the end). You want to display the field you don't have.
                You need link field (singular Step) or linkMultiple (plural Steps)?

                Comment


                • #9
                  Originally posted by tanya View Post
                  What I tried to say you - in entityDefs you defined the field prevCareerStep, on the layout you added prevCareerSteps (s letter in the end). You want to display the field you don't have.
                  You need link field (singular Step) or linkMultiple (plural Steps)?
                  Yes, I'm sorry. I resolved this. But it did not work.
                  I want link (singular Step).

                  Comment


                  • #10
                    I asked you to create such relation in Entity Manager, to see all needed definitions

                    Code:
                    {
                        "fields": {
                            "tasksChildren": {
                                "type": "linkMultiple",
                                "layoutDetailDisabled": true,
                                "layoutListDisabled": true,
                                "layoutMassUpdateDisabled": true,
                                "noLoad": true,
                                "importDisabled": true,
                                "isCustom": true
                            },
                            "nextTask": {
                                "type": "link"
                            }
                        },
                        "links": {
                            "tasksChildren": {
                                "type": "hasMany",
                                "foreign": "nextTask",
                                "entity": "Task",
                                "audited": false,
                                "isCustom": true
                            },
                            "nextTask": {
                                "type": "belongsTo",
                                "foreign": "tasksChildren",
                                "entity": "Task",
                                "audited": false,
                                "isCustom": true
                            }
                        }
                    }

                    Comment


                    • #11
                      I want Career Steps data to come in prevCareerSteps and nextCareerSteps while I am in the Career Steps area.
                      Is this the code you are going to do this? Right ?

                      Comment


                      • #12
                        This code (fields and rels definition) allows you to link one task to other task

                        Comment


                        • #13
                          OK I did it. Thank you so much. You're awesome tanya

                          Comment

                          Working...
                          X