Skip to content

Commit 8ee1a43

Browse files
otresslerOliver Tressler
andauthored
🤖 Merge PR DefinitelyTyped#74158 [xrm] Fix return type for Xrm.ProcessFlow.Stage.getSteps by @otressler
Co-authored-by: Oliver Tressler <oliver.tressler@connectiv.de>
1 parent 28db577 commit 8ee1a43

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

‎types/xrm/index.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4709,7 +4709,7 @@ declare namespace Xrm {
47094709
* Returns a collection of steps in the stage.
47104710
* @returns An array of Step.
47114711
*/
4712-
getSteps(): Step[];
4712+
getSteps(): Xrm.Collection.ItemCollection<Step>;
47134713
}
47144714

47154715
interface Step {

‎types/xrm/xrm-tests.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,3 +777,11 @@ function testAttributeType(formContext: Xrm.FormContext) {
777777
const isNumberAttribute = attributeType === "number"; // This errors because the attribute is a StringAttribute, not a NumberAttribute
778778
const isStringAttribute = attributeType === "string"; // This works because the attribute is a StringAttribute
779779
}
780+
781+
// Demonstrate getSteps from active stage returns collection of steps
782+
function getStepsFromActiveStage(formContext: Xrm.FormContext) {
783+
const process = formContext.data.process;
784+
785+
// $ExpectType ItemCollection<Step>
786+
const steps = process.getActiveStage().getSteps();
787+
}

0 commit comments

Comments
 (0)