AnsweredAssumed Answered

Create/update a record (bool field not saving)

Question asked by ivangomez on Dec 14, 2015
Latest reply on Dec 15, 2015 by Ajay Kumar

Hi,

 

I have an example where I create a new record. All fieds are saved correctly except bool field which is always showed as checked. This is the bool field:

 

[accept_advertising] => stdClass Object

  (

  [name] => accept_advertising

  [type] => bool

  [group] =>

  [id_name] =>

  [label] => Accept advertising

  [required] => 0

  [options] => stdClass Object

  (

  [_empty_] => stdClass Object

  (

  [name] =>

  [value] =>

  )

 

  [1] => stdClass Object

  (

  [name] => 1

  [value] => Sí

  )

 

  [2] => stdClass Object

  (

  [name] => 2

  [value] => No

  )

 

  )

 

  [related_module] =>

  [calculated] =>

  [len] => 255

  [default_value] => 0

  )

 

This is the PHP code to create the record:

 

<?php

   ...
   $set_entry_parameters = array(
   "session" => $session_id,
   "module_name" => "Leads",
   "name_value_list" => array(
      array("name" => "name", "value" => "Test"),

            array("name" => "email", "value" => "test@test.com"),

      array("name" => "accept_advertising", "value" => 1) // 1 accepts advertising, 2 doesn't
   )
   );

   $set_entry_result = $client->call("set_entry", $set_entry_parameters);

?>

 

How should I do it to save the bool field?

Outcomes