1C:Enterprise 8.3. Practical Developer’s Guide. Quick developer reference. Enumerations

Enumerations

1C:Enterprise script objects used for operations with enumerations

The following chart shows the interaction between 1C:Enterprise script objects used for operations with enumerations (fig. 29.9).

Quick developer reference / Enumerations / 1C:Enterprise script objects used for operations with enumerations
Fig. 29.9. 1C:Enterprise script objects used for operations with enumerations

Note. The object method from which the arrow originates is marked with the respective number in the listing, while the target object of the arrow is the type of returned object.

Learn more! For details on major types of 1C:Enterprise script objects, see section 1C:Enterprise script objects used for operations with applied data.

For examples of operations with enumerations that involve 1C:Enterprise script objects, see listing 29.7.

Listing 29.7. Object usage examples

1.  // Global context
    // Enums
 
// Example: getting an enumeration value by index.
Enums.MaterialServiceTypes.Get(0);
 
2.  // EnumsManager object
    // .<enumeration name>
    // [<enumeration name>]
    // For Each … In … Do … EndDo;
 
// Example: getting the number of enumeration values.
Enums.["MaterialServiceTypes"].Count();
 
3.  // EnumManager.<enumeration name> object
    // .<enumeration value name>
    // [<enumeration value name>]
    // [<collection element index>]
    // For Each … In … Do … EndDo;
    // EmptyRef ()
 
// Example: getting an empty reference to an enumeration value.
…
EnumEmptyRef = Enums.MaterialServiceTypes.EmptyRef();
If CurrentMaterialOrService.MaterialServiceType = EnumEmptyRef Then
   // Prompting to fill the type.
    …
EndIf;
…

Leave a Reply

Your email address will not be published. Required fields are marked *

 

1C:Enterprise Developer's Community