Tuesday, 15 February 2011

php - Update email_address_id, bean_id ,bean_module - Sugarcrm REST API -


I am working on the Gradar Brake API to update a candidate email address. First of all I am updating the email_addresses table and then in the email_addr_bean_rel table

  • For each table update, I am creating session ID and passing through the API.

  • On running the API, this update does not contain values ​​in the Email_ addresses table, but on the email_addr_bean_rel table.

Do I need to establish a relationship ??

Please help me solve this problem ...

  // login ----------------- --- ------------------------- $ login_parameters = array ("user_auth" = & gt; array ("user_name" => $ Username, "password" = & gt; MD5 ($ password), "version" => 1 ")," application_name "= & gt;" restestest "," name_qua_list "=> array () ,); $ Login_result = Call ("Login", $ Login_Permatores, $ url); // mill session session $ session_id = $ login_result-> Id; $ Set_entry_parametersEADDR = array (// session ID "session" = & gt; $ session_id, // module name to get the record. "Module_name" = & gt; "email address", // record attribute "name_value_list" = & Gt; array ('name' = & gt; 'email_address', 'value' = & gt; $ _POST ['emailid']), array ('name' = & gt; 'email_address_caps', 'value' = & gt; Array ('name' = & gt; 'opt_out', 'strings', 'strings', 'strutupper' ($ _POST ['emailid']), array ('name' = & gt; 'invalid_email', 'value' => Value '= & gt;), array (' name '= & gt;' date_created ',' value '= & gt; date (' YMD HK: I: S ')), array (' name '= & gt; 'Date_modified', 'value' = & gt; date ('YMD HK: I: S')), array ('name' = & gt; 'deleted' '' Value '= & gt; 0),)); $ Set_entry_result Add Email Mail = Call ("set_entry", $ set_entry_parametersEADDR, $ url); Echo "& lt; east & gt;"; Print_r ($ set_entry_resultEmailsAdd); Echo "& lt; / pre & gt;"; // login --------------------------------------------- $ login_parameters = Array ("user_auth" = & gt; array ("user_name" = & gt; $ username, "password" => md5 ($ password), "version" => 1), " Application_name "=> RestTest", "name_value_list" = & gt; array (),); $ Login_result = call ("login", $ login_permatories, $ url); // mill session session $ session_id = $ login_result- & Name; $ Set_entry_parametersEmailAddressBean = array (// session ID "session" => Module_name "= & gt;" email address ", // record for receiving from record // record Attribute "name_value_list" = & gt; array ('name' = & gt; 'email_address_id', 'Value' = & gt; $ set_entry_result email mail add- & gt; id), array ('name' = & gt; 'bean_id', 'value' => $ set_entry_result- array ('name' = & gt; ('Name_ =' = ' = & Gt; 0), array ('name' = & gt; 'date_created', 'value' = & gt; Date ('YMD H: I: S')), array ('name' => date_modified ',' value '= & gt; date (' YMD HK: I: S ')), array (' name '= & Gt;' deleted ',' value '=> 1),),); $ Set_entry_resultEmailBean = Call ("set_entry", $ set_entry_parametersEmailAddressBean, $ url); Echo "& lt; east & gt;"; Print_r ($ set_entry_resultEmailBean); Echo "& lt; / pre & gt;";  

Hello You should be able to use session ID between call id.

Given_candidates to set up an email address for a custom module

Is the email field set correctly in the Gaura Candidates module?

You should not modify the email attachment table directly. Instead you should use the built-in email methods for Chinese.

For any module with an email relationship

You can set a primary email address by setting the field "email1" (or email 2 and so on But up to 5 I believe)

Although I'm not sure you can add stock email links to a custom module.


No comments:

Post a Comment