< Back
Invoke-CrmRecordWorkflow
Post
NAME Invoke-CrmRecordWorkflow
SYNOPSIS
Runs an on-demand workflow for a record.
SYNTAX
Invoke-CrmRecordWorkflow [-conn <CrmServiceClient>] [-CrmRecord <PSObject>] [-WorkflowName <String>]
[<CommonParameters>]
Invoke-CrmRecordWorkflow [-conn <CrmServiceClient>] [-CrmRecord <PSObject>] [-WorkflowId <String>]
[<CommonParameters>]
Invoke-CrmRecordWorkflow [-conn <CrmServiceClient>] [-EntityId <String>] [-WorkflowName <String>]
[<CommonParameters>]
Invoke-CrmRecordWorkflow [-conn <CrmServiceClient>] [-EntityId <String>] [-WorkflowId <String>]
[<CommonParameters>]
DESCRIPTION
The Invoke-CrmRecordWorkflow cmdlet lets you run an on-demand workflow for a record.
There are two ways to specify records.
1. Pass record's Id.
2. Get a record object by using Get-CrmRecord/Get-CrmRecords cmdlets, and pass it.
You can specify on-demand workflow by using its name.
PARAMETERS
-conn <CrmServiceClient>
A connection to your CRM organization. Use $conn = Get-CrmConnection <Parameters> to generate it.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-CrmRecord <PSObject>
A record object which is obtained via Get-CrmRecord/Get-CrmRecords. When you pass CrmRecord, then you don't
use Id.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WorkflowName <String>
An on-demand workflow name.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WorkflowId <String>
The GUID for any given workflow you want to execute
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-EntityId <String>
An Id (guid) of the record
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
NOTES
-------------------------- Example 1 --------------------------
Invoke-CrmRecordWorkflow -conn $conn -EntityId faff5970-6317-e511-80da-c4346bc43d94 -WorkflowName "Sample Workflow
for Account"
This example runs an on-demand workflow named "Sample Workflow for Account" for an account.
-------------------------- Example 2 --------------------------
Invoke-CrmRecordWorkflow faff5970-6317-e511-80da-c4346bc43d94 "Sample Workflow for Account"
This example runs an on-demand workflow named "Sample Workflow for Account" for an account by omitting parameter
names.
When omitting parameter names, you do not provide $conn, cmdlets automatically finds it.
-------------------------- Example 3 --------------------------
PS C:\\>$account = Get-CrmRecord account 00005a70-6317-e511-80da-c4346bc43d94 name
PS C:\\>Invoke-CrmRecordWorkflow -CrmRecords $account -WorkflowName "Sample Workflow for Account"
This example runs an on-demand workflow named "Sample Workflow for Account" for an account by omitting parameter
names.
RELATED LINKS
SYNOPSIS
Runs an on-demand workflow for a record.
SYNTAX
Invoke-CrmRecordWorkflow [-conn <CrmServiceClient>] [-CrmRecord <PSObject>] [-WorkflowName <String>]
[<CommonParameters>]
Invoke-CrmRecordWorkflow [-conn <CrmServiceClient>] [-CrmRecord <PSObject>] [-WorkflowId <String>]
[<CommonParameters>]
Invoke-CrmRecordWorkflow [-conn <CrmServiceClient>] [-EntityId <String>] [-WorkflowName <String>]
[<CommonParameters>]
Invoke-CrmRecordWorkflow [-conn <CrmServiceClient>] [-EntityId <String>] [-WorkflowId <String>]
[<CommonParameters>]
DESCRIPTION
The Invoke-CrmRecordWorkflow cmdlet lets you run an on-demand workflow for a record.
There are two ways to specify records.
1. Pass record's Id.
2. Get a record object by using Get-CrmRecord/Get-CrmRecords cmdlets, and pass it.
You can specify on-demand workflow by using its name.
PARAMETERS
-conn <CrmServiceClient>
A connection to your CRM organization. Use $conn = Get-CrmConnection <Parameters> to generate it.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-CrmRecord <PSObject>
A record object which is obtained via Get-CrmRecord/Get-CrmRecords. When you pass CrmRecord, then you don't
use Id.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WorkflowName <String>
An on-demand workflow name.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WorkflowId <String>
The GUID for any given workflow you want to execute
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-EntityId <String>
An Id (guid) of the record
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
NOTES
-------------------------- Example 1 --------------------------
Invoke-CrmRecordWorkflow -conn $conn -EntityId faff5970-6317-e511-80da-c4346bc43d94 -WorkflowName "Sample Workflow
for Account"
This example runs an on-demand workflow named "Sample Workflow for Account" for an account.
-------------------------- Example 2 --------------------------
Invoke-CrmRecordWorkflow faff5970-6317-e511-80da-c4346bc43d94 "Sample Workflow for Account"
This example runs an on-demand workflow named "Sample Workflow for Account" for an account by omitting parameter
names.
When omitting parameter names, you do not provide $conn, cmdlets automatically finds it.
-------------------------- Example 3 --------------------------
PS C:\\>$account = Get-CrmRecord account 00005a70-6317-e511-80da-c4346bc43d94 name
PS C:\\>Invoke-CrmRecordWorkflow -CrmRecords $account -WorkflowName "Sample Workflow for Account"
This example runs an on-demand workflow named "Sample Workflow for Account" for an account by omitting parameter
names.
RELATED LINKS