From 2c42a7e969ff1dbfd85bdc2b4e21c6535ff46d4b Mon Sep 17 00:00:00 2001 From: abhinavkumar2 Date: Wed, 4 Sep 2024 09:56:39 +0530 Subject: [PATCH] feat: anonymous apex execution --- src/utils/apex/executor/AnonymousApexRunner.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/utils/apex/executor/AnonymousApexRunner.ts diff --git a/src/utils/apex/executor/AnonymousApexRunner.ts b/src/utils/apex/executor/AnonymousApexRunner.ts new file mode 100644 index 0000000..c3227f3 --- /dev/null +++ b/src/utils/apex/executor/AnonymousApexRunner.ts @@ -0,0 +1,8 @@ +import { Org } from '@salesforce/core'; +import { ExecuteAnonymousResult } from 'jsforce'; + +export class AnonymousApexRunner { + public static async run(org: Org, anonymousApex: string): Promise { + return org.getConnection().tooling.executeAnonymous(anonymousApex); + } +}