Search.../

movePhase( )

Deprecated. This function is being discontinued in the upcoming months. We are working to provide alternatives, and we'll provide timely updates before implementing any changes. We understand that this transition might present challenges, and we appreciate your patience and understanding.

Description

Moves a phase to a new position with a workflow.

The movePhase() function returns a Promise when the specified phase has been moved to the new position.

Use the options parameter to specify the new phase position within the workflow. Any non-win phase can be moved to any non-win position. The win phase cannot be moved. Positions are zero-based, meaning the first position is 0.

This function requires you to specify the ID of a phase. To learn about retrieving IDs in the Workflow API, see Retrieving IDs.

Syntax

function movePhase(phaseId: string, options: MovePhaseOptions): Promise<void>

movePhase Parameters

NAME
TYPE
DESCRIPTION
phaseId
string

ID of the phase to move.

options
MovePhaseOptions

Information about where to move the phase.

Returns

Fulfilled - When the phase has moved.

Return Type:

Promise<void>

Was this helpful?

Move a phase

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { workflows } from 'wix-crm-backend';
3
4export const movePhase = webMethod(Permissions.Anyone, async (phaseId, workflowId) => {
5 return await workflows.movePhase(
6 phaseId,
7 {
8 "workflowId": workflowId,
9 "newPosition": 0
10 }
11 );
12});
13
14// Returns a promise that resolves to void.