在庫詳細の有効期限フィールドの表示タイプを無効にしようとしています。現在のクライアント スクリプトは、1 行目のみ、または 0 インデックスに対して機能しています。在庫の詳細を追加する際に、すべての行でこのフィールドを完全に無効にしようとしています。
これは私のスクリプトです。ここで見逃したことを教えてください。
ありがとう
function lineInit(scriptContext) {
try {
var currentRecord = scriptContext.currentRecord;
var sublistId = scriptContext.sublistId;
if (sublistId !== 'item') return;
var selectedLine = currentRecord.getCurrentSublistIndex({
sublistId: 'item'
});
log.debug({ title: 'selectedLine', details: JSON.stringify(selectedLine) });
var inventoryDetail = currentRecord.getCurrentSublistSubrecord({
sublistId: "item",
fieldId: "inventorydetail"
});
var expiryDate = inventoryDetail.getCurrentSublistField({
sublistId: "inventoryassignment",
fieldId: "expirationdate"
});
expiryDate.isDisabled = true;
} catch (error) {
log.debug({ title: 'Catch Error', details: error });
}
}