Hi Markus,
I am trying to use the code in your example but getting errors. Any help would be greatly appreciated.
The code needs to retrieve a UDP from the custom object called "RTE_Creator." In this case, it's an email that I will use to send an email.
Here's my function:
#retrieve property value given by displayname from Custom Object (ID)
function mGetCustentPropValue ([Int64] $mCentID, [STRING] $mDispName)
{
$PropDefs = $vault.PropertyService.GetPropertyDefinitionsByEntityClassId("CUSTENT")
$propDefIds = @()
$PropDefs | ForEach-Object {
$propDefIds += $_.Id
}
$mPropDef = $propDefs | Where-Object { $_.DispName -eq $mDispName}
$mEntIDs = @()
$mEntIDs += $mCentID
$mPropDefIDs = @()
$mPropDefIDs += $mPropDef.Id
$mProp = $vault.PropertyService.GetProperties("CUSTENT",$mEntIDs, $mPropDefIDs)
$mProp | Where-Object { $mPropVal = $_.Val }
Return $mPropVal
}
elseif ($customObject._NewState -eq "Approved" -and $customObject._State -eq "Review"){
$subject = "An RTE State was Changed: "
$body = "An RTE was just Approved: " + $RTENumber
$RTECreatorEmail=mGetCustentPropValue($customObject, "RTE_Creator")
Here's the error
