defining a not storable link field from existing relation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • czcpf
    Senior Member
    • Aug 2022
    • 160

    defining a not storable link field from existing relation

    Hello,

    Let's say we have EntityA, EntityB and another EntityC. How do I create a notStorable field link to EntityC in EntityA so that it can be displayed and sorted in list view. The below code works if I set entityCId and entityCName in a listLoader but sorting it doesn't work?

    Custom/Resources/metadata/entityDefs/EntityA.json

    Code:
    {
        "fields": {​
            "entityB": {
                "type": "link",
                "isCustom":true,
            },​
            "entityC": {
                "notStorable": true,
                "readOnly":true,
                "type": "linkOne",
                "isCustom":true,
           }
        },​​
        "links": {
            "entityB": {
                "type": "belongsTo",
                "foreign": "entityAs",
                "entity": "EntityB",
                "isCustom": true
            },​
            "entityC":{
                 "type": "hasOne",
                 "entity": "EntityC",
                 "skipOrmDefs": true
            }
        }
    },

    Custom/Resources/metadata/entifyDefs/EntityB.json

    Code:
    {
        "fields": {​
            "entityAs": {
                "type": "linkMultiple",
               "isCustom":true,
            },​
            "entityC": {
                "type": "link",
                "isCustom": true,
            },​
        },
        "links": {
            "entityAs": {
                "type": "hasMany",
                 "foreign": "entityB",
                 "entity": "EntityA",
                 "isCustom": true
            },​
            "entityC": {
                "type": "belongsTo",
                 "foreign": "entityBs",
                 "entity": "EntityC",
                "isCustom": true
            },​
        }
    }
    Last edited by czcpf; 08-10-2023, 10:44 PM.
Working...