Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Issues running Invoke-CrmAction (Microsoft.Xrm.Data.Powershell) from powershell

$
0
0

Hi,

I believe I am close however the function call is failing on the datatypes of the parameter values in the hashtable as follows:

Invoke-CrmAction : Exception calling "Execute" with "1" argument(s): "Input field type 'Int32' does not match expected type 'OptionSetValue' for field
'HighestOffenceLevel'"
At C:\Transfer\ServiceDateBasedRates\ServiceDateRateTest.ps1:194 char:15
+ ... $Result = Invoke-CrmAction 'lss_ACTION_TariffItemRateCalcRateOnly' ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-CrmAction

I am trying to pass in a value of 0 to the parameter. I am not embedding the value in quotes so it is interpreted as a number and there is no decimal point.

The actual action function call is:

$Result = Invoke-CrmAction 'lss_ACTION_TariffItemRateCalcRateOnly' -Parameters @{AdministrativeRate=1;AltServiceProviderType='';ContractIsCriminalStandard=0;DateContractIssued=1/1/2019;HighestOffenceLevel=0;IndictableRate=3;LawyerCallDate='';LawyerExperienceAdjustmentAmount=1.1;LinkedContractAdjustmentAmount=1;MajorRate=4;ServiceDate=2/2/2019;SummaryRate=2;UnitOfMeasure=863600000;UnitRate=5}

Any guidance on how to format the different CRM parameter data types in the action call would be help as I suspect that I will run into issues with the Money columns as well.

Thank you.

Mat


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images