Hello
Earlier in v7 we have always used the attribute isMailObject to determine if the ADSAccount has a mailbox.
Whenever we used this %isMailObject% in another column in the template code, the values has been recalculated on change (adding or removing a mailbox).
We can not use the code $FK(UID_EX0MailBox).IsLocked$) because the UID_ADSAccount is referenced on the EX0MailBox object.
Is there another $-Statement that we can use to involve a attribute form the mailbox of the user?
In v7 we use a code like this for e.g. in UserPrincipalName:
...
Dim IsMailObject As Boolean = False
Dim f As ISqlFormatter = Session.SqlFormatter
Dim qMailboxofADSAccountWhere As String = f.Comparison("UID_ADSAccount", $UID_ADSAccount$, ValType.String, CompareOperator.Equal)
IsMailObject = Connection.Exists("EX0MailBox",qMailboxofADSAccountWhere)
If IsMailObject Then
Dim sUIDEX0MailUser As String = Session.Source.GetSingleValue(Of String)("EX0MailBox", "UID_EX0MailBox", qMailboxofADSAccountWhere)
Dim oEX0MailBox As ISingleDbObject = Connection.CreateSingle("EX0MailBox", sUIDEX0MailUser)
If ( CInt(oEX0MailBox.GetValue("IsLocked")) = 0 ) Then
Value = $Mail$
End If
...
The code will not be recalculated if a mailbox is added later on, or id the mailbox is getting disabled deleted.
Is there any other possibility to trigger a calculation of a template on ADSAccount when a Mailbox is beeng created or disabled, other then to enhance the processes with executetemplantes()
Regards, René