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..d6449ed0bf324d 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(); +}