ACAPI_​TeamworkControl_​ReserveElements

Reserves elements in Teamwork mode.

    GSErrCode  ACAPI_TeamworkControl_ReserveElements (
        const GS::PagedArray<API_Guid>&      elements,
        GS::HashTable<API_Guid, short>*      conflicts = nullptr,
        bool                               enableDialogs = true
    );

 

Parameters

elements
[in] List of elements to be reserved.
conflicts
[out] List of elements which cannot be reserved (optional, can be nullptr).
enableDialogs API version 25
[in] Show dialogs during the process? (optional, by default the dialogs are enabled)

 

Return Values

NoError
The function has completed with success.
APIERR_NOPLAN
There is no open project.
APIERR_NOTEAMWORKPROJECT
The current project is not Teamwork project.

For other common errors see the list of error codes.

 

Remarks

This function attempts to reserve the elements specified with the guid list.

If the conflicts parameter is given, the function returns the list of unsuccessful reservations with the userId of the conflicting team members.

This function is a non-undoable data structure modifier function. See more details on this topic at Command Overview.

 

Example


GS::PagedArray<API_Guid>        elements;
GS::HashTable<API_Guid, short>  conflicts;

elements.Push (elementToReserve.header.guid);

ACAPI_TeamworkControl_ReserveElements (elements, &conflicts);
if (conflicts.IsEmpty ())
    ACAPI_WriteReport ("The element has been reserved successfully", true);

 

Requirements

Version: API 13 or later
Header: ACAPinc.h

 

See Also

ACAPI_TeamworkControl_ReleaseElements
ACAPI_Notify_CatchElementReservationChange
Teamwork Control
API Functions