Issue
When having the powerFLC ThinClientLink or ThickClientLink functions mapped in a powerJobs Processor job like the Sample.TransferItemBOMs job it fails with an "Invalid URL" error if the Vault name contains a space character.
Cause
In the function that generates the link the Vault name is not encoded. This causes the job to fail since a space character must be encoded to "%20" to generate a valid URL.
Solution 1
Install powerFLC 24.0.3 or a newer version along with powerVault 24.0.5 or a newer version
Solution 2
To fix this issue modify the functions in the module "coolOrange.powerFLC.Workflows.MappingFunctions.psm1" to encode the Vault name:
- Open the module "coolOrange.powerFLC.Workflows.MappingFunctions.psm1" from "C:\ProgramData\coolOrange\powerJobs\Modules"
- Search for the function "GetVaultThickClientLink"
- Replace it with this updated function:
function GetVaultThickClientLink($entity) {
if ($entity._EntityTypeID -eq "ITEM") {
$objectId = [System.Web.HttpUtility]::UrlEncode($entity._Number)
$objectType = "ItemRevision"
} elseif ($entity._EntityTypeID -eq "FILE") {
$objectId = [System.Web.HttpUtility]::UrlEncode($entity._FullPath)
$objectType = "File"
} else {
return ""
}
$serverUri = New-Object Uri -ArgumentList $vault.InformationService.Url
$hostname = $serverUri.Host
if ($hostname -ieq "localhost") { $hostname = [System.Net.Dns]::GetHostName() }
$vaultName = [System.Web.HttpUtility]::UrlEncode($vaultConnection.Vault)
return "$($serverUri.Scheme)://$($hostname)/AutodeskDM/Services/EntityDataCommandRequest.aspx?Vault=$($vaultName)&ObjectId=$($objectId)&ObjectType=$($objectType)&Command=Select"
} - Search for the function "GetVaultThinClientLink"
- Replace it with this updated function:
function GetVaultThinClientLink($entity) {
$id = GetVaultPersistentId -entity $entity
$serverUri = New-Object Uri -ArgumentList $vault.InformationService.Url
$hostname = $serverUri.Host
if ($hostname -ieq "localhost") { $hostname = [System.Net.Dns]::GetHostName() }
$vaultName = [System.Web.HttpUtility]::UrlEncode($vaultConnection.Vault)
return "$($serverUri.Scheme)://$($hostname)/AutodeskTC/$($hostname)/$($vaultName)#/Entity/Details?id=m$($id)&itemtype=$($entity._EntityType.DisplayName)"
}
See Also
- HttpUtility.UrlEncode (Microsoft docs)
- Copy Hyperlink (Autodesk Knowledge Network)
- mapping functions