- Knowledge base
- powerJobs Processor
- Troubleshooting
$customObject variable is missing in Job
Issue
When adding a job via the powerJobs Processor settings dialog the $customObject is missing in the job
Cause
This happens because the powerJobs Processor settings dialog sets the EntityClassId of the job to a global unique id instead of "CUSTENT"
Solution 1
Update powerJobs Processor to version v25.0.17.
Solution 2
If an update is not possible you can create your own custom object using the following workaround. Add the following lines at the top of your custom entity job script:
if (-not $customObject) {
$custEnt = $vault.CustomEntityService.GetCustomEntitiesByIds($job.EntityId)[0]
$global:customObject = New-Object Autodesk.DataManagement.Client.Framework.Vault.Currency.Entities.CustomObject($vaultConnection, $custEnt)
}