We are synchronizing a property from the target system to One Identity database. The issue poped up, when we deleted an object in One identity database to check if the Formatting script works properly.
However the synchronization log returned an error.
We tested this script in 4 different ways:
1. The template on the field ramained untouched, we inserted the bellow code in the Formatting script of the field.
2. The template on the field ramained untouched, we inserted the bellow code in the OnSaving script of the table.
3. The template on the field was removed, we inserted the bellow code in the Formatting script of the field.
4. The template on the field was removed, we inserted the bellow code in the OnSaving script of the table.
If String.Equals($FK(UID_LDPDomain).Ident_Domain$, Connection.GetConfigParm("Custom\LDAP\LDAPDomain")) OrElse _ (String.Equals($FK(UID_LDPDomain).Ident_Domain$, Connection.GetConfigParm("Custom\LDAP2\LDAPDomain")) AndAlso String.Equals($StructuralObjectClass$, "HIERARCHY", StringComparison.OrdinalIgnoreCase)) _ Then If String.IsNullOrWhiteSpace(Cstr(Value)) Then Throw New ViException("The UniqueKey is required, value can not be empty.", ExceptionRelevance.EndUser) End If End If
What could be the reason that the code is trigerred in either the Formatting script and in the OnSaving script if the value is inserted through the synchronization project?
The template is not triggered becouse of the condition: "If Not CBool(Variables("FULLSYNC")) Then", which means that the value is set through synchronization project property mapping.
If we remove the code from either the Formatting script and in the OnSaving script, the value is inserted as expected.