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
  • My idea is to place the code in Person.IsTemporaryDeactivated template (using Designer).
    When the field changes, the script searches for all Persons that have UID_Person as UID_RealPerson, then changes the field IsTemporaryDeactivated for all of them according to value of the field in the RealPerson.
    I don't know if it is the right way to do that or if there are a better way OOTB.
Reply
  • My idea is to place the code in Person.IsTemporaryDeactivated template (using Designer).
    When the field changes, the script searches for all Persons that have UID_Person as UID_RealPerson, then changes the field IsTemporaryDeactivated for all of them according to value of the field in the RealPerson.
    I don't know if it is the right way to do that or if there are a better way OOTB.
Children
No Data