Hello,
I need to create a custom handler for a button. It is necessary that after the button is clicked, two actions are performed sequentially: first, the record should be saved, and then a process should be triggered. My code isn't working. Could you please help?
handlers: /**SCHEMA_HANDLERS*/[ { request: "crt.CustomHandler", handler: async (request, next) => { const result = await next?.handle(request); const handlerChain = sdk.HandlerChainService.instance; // Спочатку зберігаємо дані await handlerChain.process({ type: 'crt.SaveRecordRequest', $context: request.$context, dataSourceName: "PDS" }); // Потім викликаємо процес await handlerChain.process({ type: 'crt.RunBusinessProcessRequest', $context: request.$context, processName: "srProcess_5c65949", processRunType: "ForTheSelectedPage", showNotification: true, recordIdProcessParameterName: "ID" }); return result; } } ]/**SCHEMA_HANDLERS*/,
Like
2 comments
Best reply
15:04 Aug 12, 2024
Ігор Роїк,
Hello,
Have you tried importing a "creatio-devkit/common dependecies" as well as passing sdk as a parameter to your schema function?
15:04 Aug 12, 2024
Ігор Роїк,
Hello,
Have you tried importing a "creatio-devkit/common dependecies" as well as passing sdk as a parameter to your schema function?
Show all comments