Skip to content
Snippets Groups Projects
actions.md 1.77 KiB
Newer Older
  • Learn to ignore specific revisions
  • Most entities support the following actions:
    
    
    Insert or update one record. (Note: If an `id` is specified, then an
    
    existing record will be modified.)
    
    
    Delete one record. (Note: Requires an explicit `id`. Note: if you
    
    want to skip the 'recycle bin' for entities that support undelete (e.g.
    
    contacts) you should set `$param['skip_undelete'] => 1);`
    
    
    Search for records
    
    
    
    Search for records and return the first or only match. (Note: This
    returns the record in a simplified format which is easy to use)
    
    
    Does a `getsingle` and returns a single value - you need to also set
    
    Search for records and return the quantity. (Note: In many cases in
    early versions queries are limited to 25 so this may not always be
    accurate)
    
    
    
    Counts the number of references to a record
    
    
    
    Fetch entity metadata, i.e. the list of fields supported by the entity
    
    
    
    Used for autocomplete lookups by the
    
    totten's avatar
    totten committed
    [entityRef](https://wiki.civicrm.org/confluence/display/CRMDOC/EntityRef+Fields) widget
    
    
    Returns the options for a specified field e.g.
    
    civicrm_api3(
    
      'Contact',
    
      array('field' => 'gender_id')
    
      1 => 'Female',
      2 => 'Male',
    
      3 => 'Transgender'
    )
    
    
    Replace an old set of records with a new or modified set of records.
    (For example, replace the set of "Phone" numbers with a different set of
    
    Warning - REPLACE includes an implicit delete - use with care & test well
    
    
    **Deprecated.** Use the create action with the param 'id' instead.
    
    
    
    **Deprecated.** Use the create action with the param 'id' instead.