从父自定义记录类型访问子自定义记录类型

Access child custom record type from parent custom record type

我创建了一个名为 PALLET 的自定义记录类型作为父行,并创建了一个自定义记录类型 COMPONENT 作为子行,因为它是一对多关系。换句话说,一个 PALLET 可以有多个 COMPONENTS。我可以从 suitescript 访问 PALLET,如下所示

function beforeSubmit(context) {
    var record = context.newRecord;
    record.setValue('custrecord166', '8888'); 
}

但是,我无法使用 suitescrpt 从 PALLET 访问 COMPONENT,它 return -1

function beforeSubmit(context) {
    var record = context.newRecord;
    var lineCount = record1.getLineCount({sublistId:"recmachcustomrecord_pallet_component"});
}

欢迎提出任何建议

从 parent 帐户引用时的子列表 ID 是 recmach+ child 记录上自定义字段的 字段 ID with 标记为 parent.

parent 记录 = customrecordparent123(名为“我的 Parent 记录”)

child记录=customrecordchild123

在您的 child 记录上,您将有一个 list/record 类型的自定义字段,类型为“我的 Parent 记录”。

此字段将勾选“记录为 parent”。假设这个字段的 id 是 custrecordmylinkedparent.

当您引用 child 记录作为子列表的一部分时,它将是 sublistId:'recmachcustrecordmylinkedparent',引用 child 记录字段。

!!请记住,recmach 不是 parent 记录,而是 child 记录上的链接字段。