Let the platform do the work

set_entries

Overview

Create or update a list of records.

Available APIs

  • SOAP
  • REST

Definition

set_entries(session, module_name, name_value_lists)

Parameters

Name Type Description
session String Session ID returned by a previous login call.
module_name String The name of the module from which to retrieve records. Note: This is the modules key which may not be the same as the modules display name.
name_value_lists name_value_lists | Array The an array of name/value lists containing the record attributes.

Result

Name Type Description
result new_set_entries_result | Array The call result.
result.ids Array The list of record IDs that were created or updated

Change Log

Version Change
v2 Return type was changed from set_entry_result to new_set_entries_result.

Considerations

  • To update an existing record, you will need to specify 'id' for the name_value_list item in the name_value_lists parameter.
  • To create a new record with a specific ID, you will need to set 'new_with_id' in the name_value_list item in the name_value_lists parameter.

Examples

PHP

$set_entries_parameters = array(
    //Session id
    "session" => $session_id,

    //The name of the module from which to retrieve records.
    "module_name" => "Accounts",

    //Record attributes
    "name_value_lists" => array(
        array(
            //to update a record
            /*
            array(
                "name" => "id",
                "value" => "da0b107d-cfbc-cb08-4f90-50b7b9cb9ad7"
            ),
            */

            //to create a new record with a specific ID
            /*
            array(
                "name" => "new_with_id",
                "value" => 1
            ),
            */
            array(
                "name" => "name",
                "value" => "Example Account 1"
            ),
        ),
        array(
            //to update a record
            /*
            array(
                "name" => "id",
                "value" => "da0b107d-cfbc-cb08-4f90-50b7b9cb9ad7"
            ),
            */

            //to create a new record with a specific ID
            /*
            array(
                "name" => "new_with_id",
                "value" => 1
            ),
            */

            array(
                "name" => "name",
                "value" => "Example Account 2"
            ),
        ),
    )
,);

Topics