Results 1 to 2 of 2

Thread: Issue with set_entry

  1. #1
    roberti is offline Junior Member
    Join Date
    Nov 2010
    Location
    Bavaria
    Posts
    6

    Default Issue with set_entry

    Hi all,

    I am a sugar rabbitt, so please excuse if this has been discussed in this forum before:

    I'm currentl playing with a couple of PHP SOAP routines that read data from Sugar, do some computation externally and rewrite the data as a mass update to custom fields in Sugar. (i.e. compose an url from stored information and store the link in a custom field). The DB has about 1700 records.

    So far, the code works fine with less than 70 records, then stops without notice or error. I've checked the result code of the "last" working set_entry call. I assume my problem could be related to a memory allocation or possibly a browser timeout issue, but didn't find any hints googeling around. Any help would be greatly appreciated.

    Here a code example (composes a google maps link and updates the custom field map_c in Accounts)



    $c = $soap->getrecordcount('Accounts');
    $result=$soap->getAccounts("",$c," accounts.name asc");

    if($result['result_count']>0){
    foreach($result['entry_list'] as $record){
    $array= $soap->nameValuePairToSimpleArray($record['name_value_list']);

    $map = $soap->create_map_url(
    $array['billing_address_postalcode'],
    $array['billing_address_city'],
    $array['billing_address_street']
    );
    $result = $soap->update_map('Accounts', $array['id'], $map);
    }
    }

    -------
    Functions:

    function getAccounts($query='',$maxnum=0,$orderby=' accounts.name asc') {
    $result = $this->proxy->get_entry_list(
    $this->sess,
    'Accounts',
    $query,
    $orderby,
    0,
    array(
    'id',
    'name',
    'billing_address_name',
    'billing_address_street',
    'billing_address_postalcode',
    'billing_address_city',
    'billing_address_country',
    'phone_office',
    'phone_fax',
    ),
    $maxnum,
    false
    );
    return $result;
    }


    function nameValuePairToSimpleArray($array) {
    $my_array=array();
    while(list($name,$value)=each($array)){
    $my_array[$value['name']]=$value['value'];
    }
    return $my_array;
    }


    function getrecordcount($module) {
    $count = $this->proxy->get_entries_count($this->sess, $module,'','0');
    return $count[result_count];
    }

    function create_map_url($zip, $city, $street) {
    $search = urlencode($street)."+".$zip."+".urlencode($city);
    $google_url = "http://maps.google.de/maps?f=q&source=s_q&hl=de&geocode=&z=16&q=".$searc h;
    return $google_url;
    }


    function update_map($module, $id, $map) {
    $fields = array(
    array(
    'name' => 'id',
    'value' => $id
    ),
    array(
    'name' => 'map_c',
    'value' => $map
    ),
    );
    $result = $this->proxy->set_entry($this->sess, $module, $fields);
    return $result;
    }

  2. #2
    roberti is offline Junior Member
    Join Date
    Nov 2010
    Location
    Bavaria
    Posts
    6

    Default Re: Issue with set_entry

    Sigh .. found the solution by myself. Problem was related to PHP max execution time.
    Increasing the execution time limit to 6 minutes helped.

    ini_set('max_execution_time', 600);

    Robert

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Forcing id with set_entry
    By franzSL in forum Developer Help
    Replies: 4
    Last Post: 2010-04-16, 07:20 AM
  2. SOAP: set_entry not working
    By Developer58 in forum Developer Help
    Replies: 7
    Last Post: 2008-09-09, 05:04 PM
  3. no response to set_entry
    By eshilon in forum Developer Help
    Replies: 0
    Last Post: 2008-01-06, 03:01 PM
  4. SOAP API set_entry
    By Shearer in forum Help
    Replies: 1
    Last Post: 2006-12-18, 05:08 PM
  5. Problems in using set_entry
    By ales in forum Developer Help
    Replies: 2
    Last Post: 2006-10-15, 08:19 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •