我正在尝试禁用库存详细信息中到期日期字段的显示类型。当前客户端脚本仅适用于第一行或 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 });
}
}