SetDomain

SetDomain(CX_xxxxx, WRITE)

Parameter:  class identifier

Stack
Stack Position Description
Stack(In) top bit pattern
Stack(Out)   -

Inside Layer, it is possible to sub-divide objects of one class. The bit pattern specifies, whether CreatePersObject puts the generated object into the Root EP Collection of a Domain or not. If the k-th bit (starting on the right) is 1, the object will be adopted into the k-th domain. Default is 1, meaning the object will be put into the Root EP Collection of the 1st domain.
The following Example shows the connection between Layer, Domain and Bit Pattern für Inheritance.

 SetDomain(CX_xxxxx, READ)

Parameter:  class identifier

Stack
Stack Position Object type / Description
Stack(In) top bit pattern
Stack(Out)   -

Selects a domain for read access. If objects are accessed with FindFirst, FindExists, Find or FindAll,  the set k-th domain defines, in which Root EP Collection to search.
At this stage, domains cannot be linked yet! The set read domain controls the access path evaluation.

// Set the read and write domains for invoices and credit notes to 2

2 SetDomain(CX_INVOICE, READ)
2 SetDomain(CX_INVOICE, WRITE)
2 SetDomain(CX_CREDIT_NOTE, READ)
2 SetDomain(CX_CREDIT_NOTE, WRITE)