Hello,
I am trying to remove all business roles a person has assigned from a VB script. It runs but there are no errors and the records are still there. Nothing in the Job Queue pending. Here is my code, can anybody help out on what else I need?
'Query all business roles for Person
colImport = Connection.CreateCol("PersonInOrg")
colImport.Prototype.WhereClause = "UID_Person = '"+uidPerson+"'"
colImport.Load(CollectionLoadType.Slim)
'Remove each business role
For Each elem In colImport
Try
obj = elem.Create()
obj.Delete()
obj.Save()
If debug Then VID_Write2Log(logFile,String.Format("Business Role removed ok"))
Catch ArgumentException As Exception
VID_Write2Log(logFile,String.Format("Business Role removal for PersonInOrg failed: {0}",ArgumentException.ToString))
End Try
Next
Thanks in advance.