Attribute templates on INSERT/UPDATE in verson 6

Hello guys,

I'm working with the Q1IM version 6.1.4 and I'm stuck in my template scripting for a custom Person attribute (made by the schema extension tool). The goal is to:
- set a default value for this attribute when a new Person is created
- set an another value only if the Person becomes inactive
My custom attribute has a defined list of values(0,1..etc)

Here is my template script:
If Not $[IsLoaded]:Bool$ Then
Value = 0
Else If $IsInactive[c]$ Then
If $IsInactive:Bool$ Then
Value = 1
End If
End If


It doesn't work for the creation (Person INSERT), but it works perfectly when Person becomes inactive. I also noticed that, when I add a new Person object using ObjectBrowser, my attribute remains empty.
But if I run the Template calculation manually, it fills correctly my attribute.

Do you have any suggestion?Could you please help?

Parents
  • I've found a workaround by using Table properties template (OnSaving) for a default value.
    And I kept the attribute (column) template for futher updates:

    Table properties/Script(OnSaving):
    If $<attribute>$ = "" Then
           Base.PutValue("<attribute>", <value>)
    End If

    => which will fill a value when the object is being saved. So it won't be visible on the object when you initiate the creation, but it will be filled once you saved it.

    Column properties:
    If $IsInActive[c]:Bool$ Then
         If $IsInActive:Bool$ Then
               Value = <value>
         End If
    End If

    => which will update this attribute only if Person gets inactive

Reply
  • I've found a workaround by using Table properties template (OnSaving) for a default value.
    And I kept the attribute (column) template for futher updates:

    Table properties/Script(OnSaving):
    If $<attribute>$ = "" Then
           Base.PutValue("<attribute>", <value>)
    End If

    => which will fill a value when the object is being saved. So it won't be visible on the object when you initiate the creation, but it will be filled once you saved it.

    Column properties:
    If $IsInActive[c]:Bool$ Then
         If $IsInActive:Bool$ Then
               Value = <value>
         End If
    End If

    => which will update this attribute only if Person gets inactive

Children
No Data