Public/Set-PatientSoftDeleted.ps1
function Set-PatientSoftDeleted { param( [Parameter(Mandatory, Position = 0, ValueFromPipeline)] [ValidateNotNullOrEmpty()] [PSObject]$Patient ) process { $body = [PSCustomObject]@{ phecc__Deleted__c = $true } $json = ConvertTo-Json $body -Depth 100 $sfPatient = Invoke-SfApi -Path "/sobjects/phecc__Patient__c/$($Patient.sfPatient.Id)" -Method Patch -Body $json } } |