From 8ee1a4326b752379972a11c74d55a8506dbb40dc Mon Sep 17 00:00:00 2001 From: Oliver Tressler <19148386+otressler@users.noreply.github.com> Date: Fri, 28 Nov 2025 13:49:00 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74158=20[xrm]?= =?UTF-8?q?=20Fix=20return=20type=20for=20Xrm.ProcessFlow.Stage.getSteps?= =?UTF-8?q?=20by=20@otressler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Oliver Tressler --- types/xrm/index.d.ts | 2 +- types/xrm/xrm-tests.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/types/xrm/index.d.ts b/types/xrm/index.d.ts index de255ef0e36046..5398b2db16d893 100644 --- a/types/xrm/index.d.ts +++ b/types/xrm/index.d.ts @@ -4709,7 +4709,7 @@ declare namespace Xrm { * Returns a collection of steps in the stage. * @returns An array of Step. */ - getSteps(): Step[]; + getSteps(): Xrm.Collection.ItemCollection; } interface Step { diff --git a/types/xrm/xrm-tests.ts b/types/xrm/xrm-tests.ts index 073651944d3670..06502416dd9073 100644 --- a/types/xrm/xrm-tests.ts +++ b/types/xrm/xrm-tests.ts @@ -777,3 +777,11 @@ function testAttributeType(formContext: Xrm.FormContext) { const isNumberAttribute = attributeType === "number"; // This errors because the attribute is a StringAttribute, not a NumberAttribute const isStringAttribute = attributeType === "string"; // This works because the attribute is a StringAttribute } + +// Demonstrate getSteps from active stage returns collection of steps +function getStepsFromActiveStage(formContext: Xrm.FormContext) { + const process = formContext.data.process; + + // $ExpectType ItemCollection + const steps = process.getActiveStage().getSteps(); +} \ No newline at end of file From 86f44b5ee78b2ea5c25b8deb9f6f5d846042cf56 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Fri, 28 Nov 2025 12:49:46 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/xrm/xrm-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/xrm/xrm-tests.ts b/types/xrm/xrm-tests.ts index 06502416dd9073..d6449ed0bf324d 100644 --- a/types/xrm/xrm-tests.ts +++ b/types/xrm/xrm-tests.ts @@ -783,5 +783,5 @@ function getStepsFromActiveStage(formContext: Xrm.FormContext) { const process = formContext.data.process; // $ExpectType ItemCollection - const steps = process.getActiveStage().getSteps(); -} \ No newline at end of file + const steps = process.getActiveStage().getSteps(); +}