Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion types/xrm/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Step>;
}

interface Step {
Expand Down
8 changes: 8 additions & 0 deletions types/xrm/xrm-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Step>
const steps = process.getActiveStage().getSteps();
}