tryAddDeferred

tryAddDeferred(value: MemberType): Boolean receiverByReference, updating,                        abstract;

The tryAddDeferred method of the Collection class attempts to add the value specified by the value parameter to the collection if it is not already present. For persistent dictionaries, the attempt is queued and executed when the database transaction commits. For transient dictionaries, the attempt is executed immediately.

This method returns true if a dictionary is persistent or the dictionary is transient and the value was added; otherwise it returns false.

This method supports only collection types that can contain objects (that is, it is not supported for primitive arrays) and for all collection instance lifetimes.

Member key dictionaries with a no‑duplicates constraint raise exception 1310 (Key already used in this dictionary) when the collection already contains the member key or keys with a different value, because the tryAddDeferred method is attempting to add a different object that conflicts with an existing entry.

2020.0.01 and higher