I get an error whenever I try to set the Country Business object, either as a childhandle or asObject. I have no idea why this keeps getting an error 88.
'Title: UDF_Alt_Country_Code
'Desc: Autofill the UDF_Alt_Country_Code after selecting Country Code
'Bus Object: SY_Country_Bus
'Event: Column post validate on CountryCode
'Version 1.02
retVal = 0
CountryCode = ""
AltCountryCode = ""
oRegion = 0
oCountry = 0
If oSession.CompanyCode = "ADX" OR oSession.CompanyCode = "ZIT" OR oSession.CompanyCode = "ZZZ" then
retVal = oBusObj.GetValue("COUNTRYCODE$",CountryCode)
retVAl = oScript.DebugPrint("GOT HERE 1." & " " & CountryCode & " " & oCountry)
'1st attempt set oCountry = oBusObj.AsObject(oBusObj.GetChildHandle("CountryCode"))
nCountry=0 : nCountry = oSession.GetObject("SY_Country_BUS")
retVAl = oScript.DebugPrint("GOT HERE 2." & " " & CountryCode & " nCountry: " & nCountry)
Set oCountry = oSession.AsObject(nCountry)
retVAl = oScript.DebugPrint("GOT HERE 3." & " " & CountryCode & " " & oCountry)
if oCountry <> 0 then
Set oCountry = oScript.AsObject(oCountry)
retVal = oCountry.Find(CountryCode)
retVal = oCountry.GetValue("AltCountryCode",AltCountryCode)
retVAl = oScript.DebugPrint("GOT HERE 2." & AltCountryCode)
retVal = oBusObj.setvalue("UDF_Alt_Country_Code$",AltCountryCode)
End If
End If