syncManyToManyData()

Overview

public boolean function syncManyToManyData(
      required string  sourceObject       
    , required string  sourceProperty     
    , required string  sourceId           
    , required string  targetIdList       
    ,          boolean requiresVersionSync = true
    ,          boolean isDraft             = false
)

Synchronizes a record's related object data for a given property. Returns true on success, false otherwise.

Arguments

NameTypeRequiredDescription
sourceObjectstringYesThe object that contains the many-to-many property
sourcePropertystringYesThe name of the property that is defined as a many-to-many relationship
sourceIdstringYesID of the record whose related data we are to synchronize
targetIdListstringYesComma separated list of IDs of records representing records in the related object
requiresVersionSyncbooleanNo (default=true)
isDraftbooleanNo (default=false)

Example

presideObjectService.syncManyToManyData(
          sourceObject   = "event"
        , sourceProperty = "tags"
        , sourceId       = rc.eventId
        , targetIdList   = rc.tags // e.g. "635,1,52,24"
);