Merged PR 45: 値変更イベント非同期処理対応

原因:
ChangeイベントはPromiseの返し値を待たせないので、アクション処理途中event完了してしまうことがあります
対策:
値変更イベントは処理完了後、kintone.app.recordをリセットするように対応します

Related work items: #508
This commit is contained in:
Shohtetsu Ma
2024-07-12 05:28:28 +00:00
committed by Takuto Yoshida(タクト)

View File

@@ -42,7 +42,12 @@ $(function (){
const flow=ActionFlow.fromJSON(flowinfo.content);
if(flow!==undefined){
const process = new ActionProcess(event.type,flow,event);
process.exec();
process.exec().then((res)=>{
const record = event.record;
kintone.app.record.set({record});
}).catch((err)=>{
console.error(err);
});
}
return event;
});
@@ -58,7 +63,7 @@ $(function (){
await process.exec();
}
const record = event.record;
kintone.app.record.set({record})
kintone.app.record.set({record});
});
});
}