add_objects()

Adds objects to a portfolio. With replace=True the portfolio is cleared first, making the given objects its complete new content.

1. Signature

  • Sync

  • Async

ecm.portfolio.add_objects(portfolio: ECMPortfolio | int,
                          objects: Iterable[ECMPortfolioObjectLike],
                          *, replace: bool = False) -> None
await ecm.portfolio.add_objects(...) -> None

2. Parameters

Parameter Type Default Description

portfolio

ECMPortfolio | int

The portfolio or its numeric ID.

objects

Iterable

The objects to add: ECMPortfolioObject, (id, type_id) pairs or model instances.

replace

bool

False

True clears the portfolio before adding (Mode=1).

When the portfolio is restricted to an object type, the server rejects members of other types.

3. Example

doc = ecm.dms.get(Unittest_DMS_Document, 83)

ecm.portfolio.add_objects(portfolio, [doc])                    # extend
ecm.portfolio.add_objects(portfolio, [doc], replace=True)      # replace