Checking if an object already exist

0
It must be friday after a long week because I probably make a simple mistake here. I wanted to check that when a new object is created an object with the same name does not exist already in the database. I used this Xpath for the retrieve: [Name = $NewObject/Name] [id != $NewObject/id] Strangly this did not work. I would still retrieve an object but this object was the $NewObject. II then tried to do this: Do a retrieve with just [Name = $NewObject/Name] and then to a list function to substract the newobject ($NotificatieTemplate in the picture). I would expect an empty list afterwards but this was the result: The NotificatieTemplateDubbel still holds 1 record which is the same record I just substracted. What am I doing wrong here? Regards, Ronald
asked
1 answers
0

Try this retrieve:

[contains(Name,$InputObject/Name)] [id!=$InputObject]

or

[Name = $InputObject/Name] [id!=$InputObject]

And then just do an empty check on the retrieved object.

Then you don't have to use a list function.

answered