如何在自定义区域中使用 cloudkit js 分配对记录的引用?

How to assign reference to record using cloudkit js in custom zone?

这是我现在拥有的:

var set = {
    recordType: 'Set', 
    fields: {
       name: { 
           value: 'AAB', 
           type: 'STRING' 
       },
       territory: {
           value: {
               recordName: "4CCA13D2-F52A-47D0-A690-46A556D0CB38",
               action: "DELETE_SELF", 
               zoneID: "territories"
           }, 
           type: "REFERENCE"
        }
    }, 
    zoneID: "territories"
};

我已经创建了区域 territories 但它已成功保存到 icloud 但保存到默认区域。为什么?

问题是:

您需要将地区父级添加到此记录:

var set = {
    recordType: 'Set',
    fields: {
        name: { value: 'WWWWW', type: 'STRING' },
        territory: {
            value: {
                recordName: "4CCA13D2-F52A-47D0-A690-46A556D0CB38",
                action: "DELETE_SELF", zoneID: "territories"
            },
            type: "REFERENCE"
        }
    },
    zoneID: "territories",
    parent:
    {
        recordName: "4CCA13D2-F52A-47D0-A690-46A556D0CB38"
    }
};