This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to create an IsTemporaryDeactivated cascade

Hi. I'm trying to disable a dummy user when the RealPerson is disabled.

My idea is to insert the following code in the field IsTemporaryDeactivated of table Person.

The code finds all connected dummy Persons then disables them.

 

Dim colPersons As IColDbObject
Dim dbPerson As ISingleDbObject

colPersons = Connection.CreateCol("Person")
colPersons.Load()
colPersons.Prototype.PutValue("UID_RealPerson", $UID_Person$)

For Each colElement As IColElem In colPersons
   dbPerson = colElement.Create()
   dbPerson.PutValue("IsTemporaryDeactivated", $IsTemporaryDeactivated:Bool$)
   dbPerson.Save()
Next

My question is: is this the right way to achive the result? IsTemporaryDeactivated cascade

Parents
  • "Right way?" Not sure there is such a thing. But it is not how I would solve it. Instead of pushing in the template, I would probably use the Person.OnSaved() table script. Or alternatively, use the templates to pull the change rather than push.
Reply
  • "Right way?" Not sure there is such a thing. But it is not how I would solve it. Instead of pushing in the template, I would probably use the Person.OnSaved() table script. Or alternatively, use the templates to pull the change rather than push.
Children
No Data