chicks / sugarcrm

A ruby based REST Client for SugarCRM
MIT License
90 stars 64 forks source link

Inconsistent Behavior on associate! method #28

Closed frugardc closed 13 years ago

frugardc commented 13 years ago

I am narrowing these problems with relationships a bit I think. Given this test below, I get different results in repeating the test multiple times. About half the time it works and makes the association, half the time it bombs out. Pasted the output of the multiple runs below the code. Maybe this helps?

require 'test_helper'

class SugarContactTypeTest < ActiveSupport::TestCase
    context "a SugarCRM::Sid1ContactType " do   
        setup do
            @contact_type = SugarCRM::Sid1ContactType.new
            @contact_type.types_c = "z_loc"
            @contact_type.save
            puts @contact_type.id
            @contact = SugarCRM::Contact.first
            @opportunity = SugarCRM::Opportunity.find("11213eea-4212-4901-2a13-4d457e9b2b04")
        end

        should "be able to add a contact and an opportunity" do
            assert @contact_type.associate!(@contact)
            assert @opportunity.associate!(@contact_type)
            puts @contact_type.id
        end
    end
end

cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb Loaded suite unit/sugar_contact_type_test Started bca50141-a4fc-a335-a5b7-4d4722816012 E Finished in 1.357529 seconds.

1) Error: test: a SugarCRM::Sid1ContactType should be able to add a contact and an opportunity. (SugarContactTypeTest): SugarCRM::AssociationFailed: Couldn't associate Opportunities: 11213eea-4212-4901-2a13-4d457e9b2b04 -> #<SugarCRM::Sid1ContactType assigned_user_id: nil, assigned_user_name: nil, contacts_sid1_contact_types_name: nil, created_by: nil, created_by_name: nil, date_entered: nil, date_modified: nil, deleted: false, description: nil, id: "bca50141-a4fc-a335-a5b7-4d4722816012", modified_by_name: nil, modified_user_id: nil, name: nil, opportunities_sid1_contact_types_name: nil, team_count: nil, team_id: nil, team_name: nil, team_set_id: nil, types_c: "z_loc">: bca50141-a4fc-a335-a5b7-4d4722816012!

1 tests, 1 assertions, 0 failures, 1 errors cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb Loaded suite unit/sugar_contact_type_test Started a370086a-95d1-0cfa-71cb-4d4722231a02 E Finished in 1.432595 seconds.

1) Error: test: a SugarCRM::Sid1ContactType should be able to add a contact and an opportunity. (SugarContactTypeTest): SugarCRM::AssociationFailed: Couldn't associate Opportunities: 11213eea-4212-4901-2a13-4d457e9b2b04 -> #<SugarCRM::Sid1ContactType assigned_user_id: nil, assigned_user_name: nil, contacts_sid1_contact_types_name: nil, created_by: nil, created_by_name: nil, date_entered: nil, date_modified: nil, deleted: false, description: nil, id: "a370086a-95d1-0cfa-71cb-4d4722231a02", modified_by_name: nil, modified_user_id: nil, name: nil, opportunities_sid1_contact_types_name: nil, team_count: nil, team_id: nil, team_name: nil, team_set_id: nil, types_c: "z_loc">: a370086a-95d1-0cfa-71cb-4d4722231a02!

1 tests, 1 assertions, 0 failures, 1 errors cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb Loaded suite unit/sugar_contact_type_test Started 7ba708b9-798b-1b56-e47e-4d47221f0812 7ba708b9-798b-1b56-e47e-4d47221f0812 . Finished in 1.350518 seconds.

1 tests, 2 assertions, 0 failures, 0 errors cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb Loaded suite unit/sugar_contact_type_test Started 4b4d9830-1808-ac3f-5940-4d472227da6f 4b4d9830-1808-ac3f-5940-4d472227da6f . Finished in 1.346763 seconds.

1 tests, 2 assertions, 0 failures, 0 errors cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb Loaded suite unit/sugar_contact_type_test Started 9e9f57d6-1738-d68c-d471-4d47222d27cf 9e9f57d6-1738-d68c-d471-4d47222d27cf . Finished in 1.38408 seconds.

1 tests, 2 assertions, 0 failures, 0 errors cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb Loaded suite unit/sugar_contact_type_test Started 9f689f17-0081-88f5-efe7-4d4722aa5a27 E Finished in 1.443279 seconds.

1) Error: test: a SugarCRM::Sid1ContactType should be able to add a contact and an opportunity. (SugarContactTypeTest): SugarCRM::AssociationFailed: Couldn't associate Opportunities: 11213eea-4212-4901-2a13-4d457e9b2b04 -> #<SugarCRM::Sid1ContactType assigned_user_id: nil, assigned_user_name: nil, contacts_sid1_contact_types_name: nil, created_by: nil, created_by_name: nil, date_entered: nil, date_modified: nil, deleted: false, description: nil, id: "9f689f17-0081-88f5-efe7-4d4722aa5a27", modified_by_name: nil, modified_user_id: nil, name: nil, opportunities_sid1_contact_types_name: nil, team_count: nil, team_id: nil, team_name: nil, team_set_id: nil, types_c: "z_loc">: 9f689f17-0081-88f5-efe7-4d4722aa5a27!

1 tests, 1 assertions, 0 failures, 1 errors cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb Loaded suite unit/sugar_contact_type_test Started 7b7cae09-e6f0-4992-126b-4d4722ecc104 E Finished in 1.335436 seconds.

1) Error: test: a SugarCRM::Sid1ContactType should be able to add a contact and an opportunity. (SugarContactTypeTest): SugarCRM::AssociationFailed: Couldn't associate Opportunities: 11213eea-4212-4901-2a13-4d457e9b2b04 -> #<SugarCRM::Sid1ContactType assigned_user_id: nil, assigned_user_name: nil, contacts_sid1_contact_types_name: nil, created_by: nil, created_by_name: nil, date_entered: nil, date_modified: nil, deleted: false, description: nil, id: "7b7cae09-e6f0-4992-126b-4d4722ecc104", modified_by_name: nil, modified_user_id: nil, name: nil, opportunities_sid1_contact_types_name: nil, team_count: nil, team_id: nil, team_name: nil, team_set_id: nil, types_c: "z_loc">: 7b7cae09-e6f0-4992-126b-4d4722ecc104!

1 tests, 1 assertions, 0 failures, 1 errors cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb Loaded suite unit/sugar_contact_type_test Started a314e02e-227c-1d77-7cd9-4d47225eb3bb a314e02e-227c-1d77-7cd9-4d47225eb3bb . Finished in 1.371292 seconds.

1 tests, 2 assertions, 0 failures, 0 errors cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb Loaded suite unit/sugar_contact_type_test Started a0ca6a09-80c2-3564-7b39-4d4723d1fff3 a0ca6a09-80c2-3564-7b39-4d4723d1fff3 . Finished in 1.434615 seconds.

1 tests, 2 assertions, 0 failures, 0 errors cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb Loaded suite unit/sugar_contact_type_test Started c95c0645-b062-4b92-b4e5-4d4723b4c420 c95c0645-b062-4b92-b4e5-4d4723b4c420 . Finished in 1.407025 seconds.

1 tests, 2 assertions, 0 failures, 0 errors cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb Loaded suite unit/sugar_contact_type_test Started 8391e3fd-4a2e-4538-9dd5-4d47230a21fe 8391e3fd-4a2e-4538-9dd5-4d47230a21fe . Finished in 1.41687 seconds.

1 tests, 2 assertions, 0 failures, 0 errors cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb Loaded suite unit/sugar_contact_type_test Started 7f1c99ea-8156-8207-a126-4d47239ffe74 E Finished in 1.328008 seconds.

1) Error: test: a SugarCRM::Sid1ContactType should be able to add a contact and an opportunity. (SugarContactTypeTest): SugarCRM::AssociationFailed: Couldn't associate Opportunities: 11213eea-4212-4901-2a13-4d457e9b2b04 -> #<SugarCRM::Sid1ContactType assigned_user_id: nil, assigned_user_name: nil, contacts_sid1_contact_types_name: nil, created_by: nil, created_by_name: nil, date_entered: nil, date_modified: nil, deleted: false, description: nil, id: "7f1c99ea-8156-8207-a126-4d47239ffe74", modified_by_name: nil, modified_user_id: nil, name: nil, opportunities_sid1_contact_types_name: nil, team_count: nil, team_id: nil, team_name: nil, team_set_id: nil, types_c: "z_loc">: 7f1c99ea-8156-8207-a126-4d47239ffe74!

1 tests, 1 assertions, 0 failures, 1 errors

davidsulc commented 13 years ago

This is definitely very interesting. Can you try with a different opportunity? Can you also try with assert @contact_type.associate!(@opportunity) replacing the second assertion?

Are these more consistent?

frugardc commented 13 years ago

I am at about 20 out of 20 working when switching the association around like that. Any idea why that would be?

davidsulc commented 13 years ago

Not really. I just thought it might make a difference if self is the custom module and we pass a standard module (i.e. having easy access to the more complicated module).

Can you pull https://github.com/davidsulc/sugarcrm/tree/frugardc_test and set debug to true (in the gem) and run the tests again? Run both the original way and the other ways. The branch I gave you will print the arguments that are being used in the set_relationship call. Hopefully that will show when, how, and why things go wrong...

chicks commented 13 years ago

Also... the debug logs from sugarcrm would be interesting to see. Whenever a call to set_relationship fails, we don't see much come back from Sugar. I find a quick look at the server logs will generally tell me what went wrong.

frugardc commented 13 years ago

I guess that new version requires using the sugarcrm.yml? Getting an error on it when not using it...

cfrugard@cfrugard-laptop:~/projects/sugar/test$ ruby unit/sugar_contact_type_test.rb /usr/lib/ruby/gems/1.8/gems/sugarcrm-0.9.8/lib/sugarcrm/environment.rb:12:in join': can't convert nil into String (TypeError) from /usr/lib/ruby/gems/1.8/gems/sugarcrm-0.9.8/lib/sugarcrm/environment.rb:12:ininitialize' from /usr/lib/ruby/1.8/singleton.rb:94:in new' from /usr/lib/ruby/1.8/singleton.rb:94:ininstance'

frugardc commented 13 years ago

I copied it into my 0.9.8 directory, so I didnt whack the 9.9 version. Don't think that should matter.

davidsulc commented 13 years ago

Hmm. It seems I introduced that bug this afternoon. I should be able to correct that in the next few minutes...

davidsulc commented 13 years ago

Okay, bug is fixed (pushed to HEAD on both repos). Please pull again from the https://github.com/davidsulc/sugarcrm/tree/frugardc_test branch and try again.

frugardc commented 13 years ago

Here is the output when doing it successfully from the ContactType custom module to the Opportunity.

Loaded suite unit/sugar_contact_type_test Started get_module_fields: Request: { "session": "kmsr59lvmfn03481lq5kc105a0", "module_name": "sid1_contact_types" }

get_module_fields: JSON Response: {"module_fields"=> {"types_c"=> {"required"=>1, "label"=>"Types", "name"=>"types_c", "type"=>"multienum", "options"=> {"a_loc"=>{"name"=>"a_loc", "value"=>"A Loc"}, "z_loc"=>{"name"=>"z_loc", "value"=>"Z Loc"}}}, "name"=> {"required"=>0, "label"=>"Name", "name"=>"name", "type"=>"name", "options"=>[]}, "contacts_sid1_contact_types_name"=> {"required"=>0, "label"=>"Contacts", "name"=>"contacts_sid1_contact_types_name", "type"=>"relate", "options"=>[]}, "date_modified"=> {"required"=>0, "label"=>"Date Modified", "name"=>"date_modified", "type"=>"datetime", "options"=>[]}, "deleted"=> {"required"=>0, "label"=>"Deleted", "name"=>"deleted", "default_value"=>"0", "type"=>"bool", "options"=>[]}, "created_by"=> {"required"=>0, "label"=>"Created By", "name"=>"created_by", "type"=>"assigned_user_name", "options"=>[]}, "modified_user_id"=> {"required"=>0, "label"=>"Modified By", "name"=>"modified_user_id", "type"=>"assigned_user_name", "options"=>[]}, "id"=> {"required"=>1, "label"=>"ID", "name"=>"id", "type"=>"id", "options"=>[]}, "team_name"=> {"required"=>0, "label"=>"Teams", "name"=>"team_name", "type"=>"relate", "options"=>[]}, "team_set_id"=> {"required"=>0, "label"=>"Team Set ID", "name"=>"team_set_id", "type"=>"id", "options"=>[]}, "created_by_name"=> {"required"=>0, "label"=>"Created By", "name"=>"created_by_name", "type"=>"assigned_user_name", "options"=>[]}, "assigned_user_name"=> {"required"=>0, "label"=>"User", "name"=>"assigned_user_name", "type"=>"relate", "options"=>[]}, "modified_by_name"=> {"required"=>0, "label"=>"Modified By", "name"=>"modified_by_name", "type"=>"assigned_user_name", "options"=>[]}, "assigned_user_id"=> {"required"=>0, "label"=>"Assigned User Id", "name"=>"assigned_user_id", "type"=>"relate", "options"=>[]}, "team_count"=> {"required"=>0, "label"=>"Teams", "name"=>"team_count", "type"=>"relate", "options"=>[]}, "description"=> {"required"=>0, "label"=>"Description", "name"=>"description", "type"=>"text", "options"=>[]}, "date_entered"=> {"required"=>0, "label"=>"Date Created", "name"=>"date_entered", "type"=>"datetime", "options"=>[]}, "team_id"=> {"required"=>0, "label"=>"Team Id", "name"=>"team_id", "type"=>"team_list", "options"=>[]}, "opportunities_sid1_contact_types_name"=> {"required"=>0, "label"=>"Opportunities", "name"=>"opportunities_sid1_contact_types_name", "type"=>"relate", "options"=>[]}}, "module_name"=>"sid1_contact_types", "link_fields"=> {"opportunit8131unities_ida"=> {"name"=>"opportunit8131unities_ida", "module"=>"", "bean_name"=>"", "relationship"=>"opportunities_sid1_contact_types", "type"=>"link"}, "teams"=> {"name"=>"teams", "module"=>"", "bean_name"=>"", "relationship"=>"sid1_contact_types_teams", "type"=>"link"}, "opportunities_sid1_contact_types"=> {"name"=>"opportunities_sid1_contact_types", "module"=>"", "bean_name"=>"", "relationship"=>"opportunities_sid1_contact_types", "type"=>"link"}, "contacts_s9ccaontacts_ida"=> {"name"=>"contacts_s9ccaontacts_ida", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_sid1_contact_types", "type"=>"link"}, "team_count_link"=> {"name"=>"team_count_link", "module"=>"Teams", "bean_name"=>"TeamSet", "relationship"=>"sid1_contact_types_team_count_relationship", "type"=>"link"}, "modified_user_link"=> {"name"=>"modified_user_link", "module"=>"Users", "bean_name"=>"User", "relationship"=>"sid1_contact_types_modified_user", "type"=>"link"}, "created_by_link"=> {"name"=>"created_by_link", "module"=>"Users", "bean_name"=>"User", "relationship"=>"sid1_contact_types_created_by", "type"=>"link"}, "team_link"=> {"name"=>"team_link", "module"=>"Teams", "bean_name"=>"Team", "relationship"=>"sid1_contact_types_team", "type"=>"link"}, "assigned_user_link"=> {"name"=>"assigned_user_link", "module"=>"Users", "bean_name"=>"User", "relationship"=>"sid1_contact_types_assigned_user", "type"=>"link"}, "contacts_sid1_contact_types"=> {"name"=>"contacts_sid1_contact_types", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_sid1_contact_types", "type"=>"link"}}}

set_entry: Request: { "session": "kmsr59lvmfn03481lq5kc105a0", "module_name": "sid1_contact_types", "name_value_list": {"types_c":{"name":"types_c","value":"z_loc"}} }

set_entry: JSON Response: {"id"=>"51e3018a-aa28-7381-4a4c-4d480dd23a94"}

51e3018a-aa28-7381-4a4c-4d480dd23a94 get_module_fields: Request: { "session": "kmsr59lvmfn03481lq5kc105a0", "module_name": "Contacts" }

get_module_fields: JSON Response: {"module_fields"=> {"assigned_user_id"=> {"required"=>0, "label"=>"Assigned User", "name"=>"assigned_user_id", "type"=>"relate", "options"=>[]}, "assistant_phone"=> {"required"=>0, "label"=>"Assistant Phone:", "name"=>"assistant_phone", "type"=>"phone", "options"=>[]}, "phone_home"=> {"required"=>0, "label"=>"Home:", "name"=>"phone_home", "type"=>"phone", "options"=>[]}, "portal_password"=> {"required"=>0, "label"=>"Password:", "name"=>"portal_password", "type"=>"varchar", "options"=>[]}, "date_modified"=> {"required"=>0, "label"=>"Date Modified:", "name"=>"date_modified", "type"=>"datetime", "options"=>[]}, "alt_address_postalcode"=> {"required"=>0, "label"=>"Alternate Address Postal Code:", "name"=>"alt_address_postalcode", "type"=>"varchar", "options"=>[]}, "accept_status_id"=> {"required"=>0, "label"=>"Accept Status", "name"=>"accept_status_id", "type"=>"varchar", "options"=>[]}, "team_set_id"=> {"required"=>0, "label"=>"Team Set ID", "name"=>"team_set_id", "type"=>"id", "options"=>[]}, "picture"=> {"required"=>0, "label"=>"Picture", "name"=>"picture", "type"=>"image", "options"=>[]}, "description"=> {"required"=>0, "label"=>"Description:", "name"=>"description", "type"=>"text", "options"=>[]}, "email1"=> {"required"=>0, "label"=>"Email Address:", "name"=>"email1", "type"=>"varchar", "options"=>[]}, "title"=> {"required"=>0, "label"=>"Title:", "name"=>"title", "type"=>"varchar", "options"=>[]}, "primary_address_city"=> {"required"=>0, "label"=>"Primary Address City:", "name"=>"primary_address_city", "type"=>"varchar", "options"=>[]}, "assigned_user_name"=> {"required"=>0, "label"=>"Assigned to:", "name"=>"assigned_user_name", "type"=>"relate", "options"=>[]}, "alt_address_state"=> {"required"=>0, "label"=>"Alternate Address State:", "name"=>"alt_address_state", "type"=>"varchar", "options"=>[]}, "reports_to_id"=> {"required"=>0, "label"=>"Reports to ID:", "name"=>"reports_to_id", "type"=>"id", "options"=>[]}, "email2"=> {"required"=>0, "label"=>"Other Email:", "name"=>"email2", "type"=>"varchar", "options"=>[]}, "report_to_name"=> {"required"=>0, "label"=>"Reports To:", "name"=>"report_to_name", "type"=>"relate", "options"=>[]}, "portal_password1"=> {"required"=>0, "label"=>"Password:", "name"=>"portal_password1", "type"=>"varchar", "options"=>[]}, "primary_address_state"=> {"required"=>0, "label"=>"Primary Address State:", "name"=>"primary_address_state", "type"=>"varchar", "options"=>[]}, "department"=> {"required"=>0, "label"=>"Department:", "name"=>"department", "type"=>"varchar", "options"=>[]}, "sync_contact"=> {"required"=>0, "label"=>"Sync to Outlook®:", "name"=>"sync_contact", "type"=>"bool", "options"=>[]}, "accept_status_name"=> {"required"=>0, "label"=>"Accept Status", "name"=>"accept_status_name", "type"=>"enum", "options"=> {"accept"=>{"name"=>"accept", "value"=>"Accepted"}, "none"=>{"name"=>"none", "value"=>"None"}, "tentative"=>{"name"=>"tentative", "value"=>"Tentative"}, "decline"=>{"name"=>"decline", "value"=>"Declined"}}}, "assistant"=> {"required"=>0, "label"=>"Assistant:", "name"=>"assistant", "type"=>"varchar", "options"=>[]}, "email_and_name1"=> {"required"=>0, "label"=>"Name:", "name"=>"email_and_name1", "type"=>"varchar", "options"=>[]}, "team_name"=> {"required"=>0, "label"=>"Teams", "name"=>"team_name", "type"=>"relate", "options"=>[]}, "sid1_contact_type_contacts_name"=> {"required"=>0, "label"=>"Contact Types", "name"=>"sid1_contact_type_contacts_name", "type"=>"relate", "options"=>[]}, "c_accept_status_fields"=> {"required"=>0, "label"=>"Accept Status", "name"=>"c_accept_status_fields", "type"=>"relate", "options"=>[]}, "phone_mobile"=> {"required"=>0, "label"=>"Mobile:", "name"=>"phone_mobile", "type"=>"phone", "options"=>[]}, "portal_name"=> {"required"=>0, "label"=>"Portal Name:", "name"=>"portal_name", "type"=>"varchar", "options"=>[]}, "account_name"=> {"required"=>0, "label"=>"Account Name:", "name"=>"account_name", "type"=>"relate", "options"=>[]}, "portal_active"=> {"required"=>0, "label"=>"Portal Active:", "name"=>"portal_active", "default_value"=>"0", "type"=>"bool", "options"=>[]}, "phone_other"=> {"required"=>0, "label"=>"Other Phone:", "name"=>"phone_other", "type"=>"phone", "options"=>[]}, "alt_address_country"=> {"required"=>0, "label"=>"Alternate Address Country:", "name"=>"alt_address_country", "type"=>"varchar", "options"=>[]}, "modified_by_name"=> {"required"=>0, "label"=>"Modified By:", "name"=>"modified_by_name", "type"=>"assigned_user_name", "options"=>[]}, "last_name"=> {"required"=>1, "label"=>"Last Name:", "name"=>"last_name", "type"=>"varchar", "options"=>[]}, "alt_address_city"=> {"required"=>0, "label"=>"Alternate Address City:", "name"=>"alt_address_city", "type"=>"varchar", "options"=>[]}, "account_id"=> {"required"=>0, "label"=>"Account ID:", "name"=>"account_id", "type"=>"relate", "options"=>[]}, "name"=> {"required"=>0, "label"=>"Name:", "name"=>"name", "type"=>"name", "options"=>[]}, "m_accept_status_fields"=> {"required"=>0, "label"=>"Accept Status", "name"=>"m_accept_status_fields", "type"=>"relate", "options"=>[]}, "do_not_call"=> {"required"=>0, "label"=>"Do Not Call:", "name"=>"do_not_call", "default_value"=>"0", "type"=>"bool", "options"=>[]}, "date_entered"=> {"required"=>0, "label"=>"Date Created", "name"=>"date_entered", "type"=>"datetime", "options"=>[]}, "team_count"=> {"required"=>0, "label"=>"Teams", "name"=>"team_count", "type"=>"relate", "options"=>[]}, "birthdate"=> {"required"=>0, "label"=>"Birthdate:", "name"=>"birthdate", "type"=>"date", "options"=>[]}, "created_by_name"=> {"required"=>0, "label"=>"Created By", "name"=>"created_by_name", "type"=>"assigned_user_name", "options"=>[]}, "phone_fax"=> {"required"=>0, "label"=>"Fax:", "name"=>"phone_fax", "type"=>"phone", "options"=>[]}, "alt_address_street_2"=> {"required"=>0, "label"=>"Alternate Address Street 2:", "name"=>"alt_address_street_2", "type"=>"varchar", "options"=>[]}, "campaign_name"=> {"required"=>0, "label"=>"Campaign:", "name"=>"campaign_name", "type"=>"relate", "options"=>[]}, "deleted"=> {"required"=>0, "label"=>"Deleted", "name"=>"deleted", "default_value"=>"0", "type"=>"bool", "options"=>[]}, "salutation"=> {"required"=>0, "label"=>"Salutation:", "name"=>"salutation", "type"=>"enum", "options"=> {"Dr."=>{"name"=>"Dr.", "value"=>"Dr."}, "Mrs."=>{"name"=>"Mrs.", "value"=>"Mrs."}, ""=>{"name"=>"", "value"=>""}, "Ms."=>{"name"=>"Ms.", "value"=>"Ms."}, "Mr."=>{"name"=>"Mr.", "value"=>"Mr."}, "Prof."=>{"name"=>"Prof.", "value"=>"Prof."}}}, "alt_address_street_3"=> {"required"=>0, "label"=>"Alternate Address Street 3:", "name"=>"alt_address_street_3", "type"=>"varchar", "options"=>[]}, "primary_address_street_2"=> {"required"=>0, "label"=>"Primary Address Street 2:", "name"=>"primary_address_street_2", "type"=>"varchar", "options"=>[]}, "invalid_email"=> {"required"=>0, "label"=>"Invalid Email:", "name"=>"invalid_email", "type"=>"bool", "options"=>[]}, "primary_address_street_3"=> {"required"=>0, "label"=>"Primary Address Street 3:", "name"=>"primary_address_street_3", "type"=>"varchar", "options"=>[]}, "email_opt_out"=> {"required"=>0, "label"=>"Email Opt Out:", "name"=>"email_opt_out", "type"=>"bool", "options"=>[]}, "sid1_contact_types_contacts_name"=> {"required"=>0, "label"=>"Contact Types", "name"=>"sid1_contact_types_contacts_name", "type"=>"relate", "options"=>[]}, "modified_user_id"=> {"required"=>0, "label"=>"Modified By:", "name"=>"modified_user_id", "type"=>"assigned_user_name", "options"=>[]}, "created_by"=> {"required"=>0, "label"=>"Created By", "name"=>"created_by", "type"=>"assigned_user_name", "options"=>[]}, "first_name"=> {"required"=>0, "label"=>"First Name:", "name"=>"first_name", "type"=>"varchar", "options"=>[]}, "portal_app"=> {"required"=>0, "label"=>"Portal Application:", "name"=>"portal_app", "type"=>"varchar", "options"=>[]}, "opportunity_role_fields"=> {"required"=>0, "label"=>"Account Name:", "name"=>"opportunity_role_fields", "type"=>"relate", "options"=>[]}, "team_id"=> {"required"=>0, "label"=>"Team ID:", "name"=>"team_id", "type"=>"team_list", "options"=>[]}, "opportunity_role_id"=> {"required"=>0, "label"=>"Opportunity Role ID:", "name"=>"opportunity_role_id", "type"=>"varchar", "options"=>[]}, "opportunity_role"=> {"required"=>0, "label"=>"Opportunity Role", "name"=>"opportunity_role", "type"=>"enum", "options"=> {""=>{"name"=>"", "value"=>""}, "Primary Decision Maker"=> {"name"=>"Primary Decision Maker", "value"=>"Primary Decision Maker"}, "Business Decision Maker"=> {"name"=>"Business Decision Maker", "value"=>"Business Decision Maker"}, "Technical Evaluator"=> {"name"=>"Technical Evaluator", "value"=>"Technical Evaluator"}, "Executive Sponsor"=> {"name"=>"Executive Sponsor", "value"=>"Executive Sponsor"}, "Business Evaluator"=> {"name"=>"Business Evaluator", "value"=>"Business Evaluator"}, "Technical Decision Maker"=> {"name"=>"Technical Decision Maker", "value"=>"Technical Decision Maker"}, "Other"=>{"name"=>"Other", "value"=>"Other"}, "Influencer"=>{"name"=>"Influencer", "value"=>"Influencer"}}}, "lead_source"=> {"required"=>0, "label"=>"Lead Source:", "name"=>"lead_source", "type"=>"enum", "options"=> {"Word of mouth"=>{"name"=>"Word of mouth", "value"=>"Word of mouth"}, ""=>{"name"=>"", "value"=>""}, "Partner"=>{"name"=>"Partner", "value"=>"Partner"}, "Existing Customer"=> {"name"=>"Existing Customer", "value"=>"Existing Customer"}, "Public Relations"=> {"name"=>"Public Relations", "value"=>"Public Relations"}, "Trade Show"=>{"name"=>"Trade Show", "value"=>"Trade Show"}, "Self Generated"=>{"name"=>"Self Generated", "value"=>"Self Generated"}, "Other"=>{"name"=>"Other", "value"=>"Other"}, "Direct Mail"=>{"name"=>"Direct Mail", "value"=>"Direct Mail"}, "Employee"=>{"name"=>"Employee", "value"=>"Employee"}, "Email"=>{"name"=>"Email", "value"=>"Email"}, "Web Site"=>{"name"=>"Web Site", "value"=>"Web Site"}, "Cold Call"=>{"name"=>"Cold Call", "value"=>"Cold Call"}, "Campaign"=>{"name"=>"Campaign", "value"=>"Campaign"}, "Conference"=>{"name"=>"Conference", "value"=>"Conference"}}}, "full_name"=> {"required"=>0, "label"=>"Name:", "name"=>"full_name", "type"=>"fullname", "options"=>[]}, "primary_address_country"=> {"required"=>0, "label"=>"Primary Address Country:", "name"=>"primary_address_country", "type"=>"varchar", "options"=>[]}, "primary_address_street"=> {"required"=>0, "label"=>"Primary Address Street:", "name"=>"primary_address_street", "type"=>"varchar", "options"=>[]}, "primary_address_postalcode"=> {"required"=>0, "label"=>"Primary Address Postal Code:", "name"=>"primary_address_postalcode", "type"=>"varchar", "options"=>[]}, "alt_address_street"=> {"required"=>0, "label"=>"Alternate Address Street:", "name"=>"alt_address_street", "type"=>"varchar", "options"=>[]}, "phone_work"=> {"required"=>0, "label"=>"Office Phone:", "name"=>"phone_work", "type"=>"phone", "options"=>[]}, "id"=> {"required"=>1, "label"=>"ID:", "name"=>"id", "type"=>"id", "options"=>[]}, "campaign_id"=> {"required"=>0, "label"=>"Campaign ID", "name"=>"campaign_id", "type"=>"id", "options"=>[]}}, "module_name"=>"Contacts", "link_fields"=> {"email_addresses"=> {"name"=>"email_addresses", "module"=>"EmailAddress", "bean_name"=>"EmailAddress", "relationship"=>"contacts_email_addresses", "type"=>"link"}, "quotes"=> {"name"=>"quotes", "module"=>"Quotes", "bean_name"=>"Quote", "relationship"=>"quotes_contacts_shipto", "type"=>"link"}, "leads"=> {"name"=>"leads", "module"=>"", "bean_name"=>"", "relationship"=>"contact_leads", "type"=>"link"}, "sid1_contact_types_contacts"=> {"name"=>"sid1_contact_types_contacts", "module"=>"", "bean_name"=>"", "relationship"=>"sid1_contact_types_contacts", "type"=>"link"}, "prospect_lists"=> {"name"=>"prospect_lists", "module"=>"ProspectLists", "bean_name"=>"", "relationship"=>"prospect_list_contacts", "type"=>"link"}, "direct_reports"=> {"name"=>"direct_reports", "module"=>"", "bean_name"=>"", "relationship"=>"contact_direct_reports", "type"=>"link"}, "teams"=> {"name"=>"teams", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_teams", "type"=>"link"}, "notes"=> {"name"=>"notes", "module"=>"", "bean_name"=>"", "relationship"=>"contact_notes", "type"=>"link"}, "contracts"=> {"name"=>"contracts", "module"=>"", "bean_name"=>"", "relationship"=>"contracts_quotes", "type"=>"link"}, "cases"=> {"name"=>"cases", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_cases", "type"=>"link"}, "team_count_link"=> {"name"=>"team_count_link", "module"=>"Teams", "bean_name"=>"TeamSet", "relationship"=>"contacts_team_count_relationship", "type"=>"link"}, "sid1_contaba27ct_type_ida"=> {"name"=>"sid1_contaba27ct_type_ida", "module"=>"", "bean_name"=>"", "relationship"=>"sid1_contact_type_contacts", "type"=>"link"}, "campaign_contacts"=> {"name"=>"campaign_contacts", "module"=>"", "bean_name"=>"", "relationship"=>"campaign_contacts", "type"=>"link"}, "meetings"=> {"name"=>"meetings", "module"=>"", "bean_name"=>"", "relationship"=>"meetings_contacts", "type"=>"link"}, "modified_user_link"=> {"name"=>"modified_user_link", "module"=>"Users", "bean_name"=>"User", "relationship"=>"contacts_modified_user", "type"=>"link"}, "created_by_link"=> {"name"=>"created_by_link", "module"=>"Users", "bean_name"=>"User", "relationship"=>"contacts_created_by", "type"=>"link"}, "campaigns"=> {"name"=>"campaigns", "module"=>"CampaignLog", "bean_name"=>"CampaignLog", "relationship"=>"contact_campaign_log", "type"=>"link"}, "tasks"=> {"name"=>"tasks", "module"=>"", "bean_name"=>"", "relationship"=>"contact_tasks", "type"=>"link"}, "project"=> {"name"=>"project", "module"=>"", "bean_name"=>"", "relationship"=>"projects_contacts", "type"=>"link"}, "products"=> {"name"=>"products", "module"=>"", "bean_name"=>"", "relationship"=>"contact_products", "type"=>"link"}, "accounts"=> {"name"=>"accounts", "module"=>"", "bean_name"=>"", "relationship"=>"accounts_contacts", "type"=>"link"}, "email_addresses_primary"=> {"name"=>"email_addresses_primary", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_email_addresses_primary", "type"=>"link"}, "emails"=> {"name"=>"emails", "module"=>"", "bean_name"=>"", "relationship"=>"emails_contacts_rel", "type"=>"link"}, "sid1_conta8312t_types_ida"=> {"name"=>"sid1_conta8312t_types_ida", "module"=>"", "bean_name"=>"", "relationship"=>"sid1_contact_types_contacts", "type"=>"link"}, "users"=> {"name"=>"users", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_users", "type"=>"link"}, "opportunities"=> {"name"=>"opportunities", "module"=>"Opportunities", "bean_name"=>"Opportunity", "relationship"=>"opportunities_contacts", "type"=>"link"}, "team_link"=> {"name"=>"team_link", "module"=>"Teams", "bean_name"=>"Team", "relationship"=>"contacts_team", "type"=>"link"}, "sid1_contact_type_contacts"=> {"name"=>"sid1_contact_type_contacts", "module"=>"", "bean_name"=>"", "relationship"=>"sid1_contact_type_contacts", "type"=>"link"}, "tasks_parent"=> {"name"=>"tasks_parent", "module"=>"", "bean_name"=>"", "relationship"=>"contact_tasks_parent", "type"=>"link"}, "bugs"=> {"name"=>"bugs", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_bugs", "type"=>"link"}, "assigned_user_link"=> {"name"=>"assigned_user_link", "module"=>"Users", "bean_name"=>"User", "relationship"=>"contacts_assigned_user", "type"=>"link"}, "contacts_sid1_contact_types"=> {"name"=>"contacts_sid1_contact_types", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_sid1_contact_types", "type"=>"link"}, "calls"=> {"name"=>"calls", "module"=>"", "bean_name"=>"", "relationship"=>"calls_contacts", "type"=>"link"}, "reports_to_link"=> {"name"=>"reports_to_link", "module"=>"", "bean_name"=>"", "relationship"=>"contact_direct_reports", "type"=>"link"}}}

get_entry_list: Request: { "session": "kmsr59lvmfn03481lq5kc105a0", "module_name": "Contacts", "query": "", "order_by": "id", "offset": "", "select_fields": ["assigned_user_id","assistant_phone","phone_home","portal_password","date_modified","alt_address_postalcode","accept_status_id","team_set_id","picture","description","email1","title","primary_address_city","assigned_user_name","alt_address_state","reports_to_id","email2","report_to_name","portal_password1","primary_address_state","department","assistant","sync_contact","email_and_name1","team_name","accept_status_name","phone_mobile","portal_name","sid1_contact_type_contacts_name","c_accept_status_fields","account_name","portal_active","phone_other","alt_address_country","modified_by_name","last_name","alt_address_city","account_id","name","do_not_call","date_entered","team_count","m_accept_status_fields","birthdate","created_by_name","phone_fax","alt_address_street_2","campaign_name","deleted","salutation","alt_address_street_3","primary_address_street_2","invalid_email","primary_address_street_3","email_opt_out","modified_user_id","created_by","sid1_contact_types_contacts_name","first_name","portal_app","opportunity_role_fields","team_id","opportunity_role_id","opportunity_role","full_name","lead_source","primary_address_country","primary_address_postalcode","primary_address_street","alt_address_street","phone_work","id","campaign_id"], "link_name_to_fields_array": [], "max_results": "1", "deleted": 0 }

get_entry_list: JSON Response: {"entry_list"=> [{"name_value_list"=> {"primary_address_street"=> {"name"=>"primary_address_street", "value"=>"321 University Ave."}, "primary_address_postalcode"=> {"name"=>"primary_address_postalcode", "value"=>"69623"}, "modified_user_name"=> {"name"=>"modified_user_name", "value"=>"Sugar Administrator"}, "primary_address_state"=> {"name"=>"primary_address_state", "value"=>"CA"}, "primary_address_city"=> {"name"=>"primary_address_city", "value"=>"Kansas City"}, "sid1_contact_types_contacts_name"=> {"name"=>"sid1_contact_types_contacts_name", "value"=>""}, "birthdate"=>{"name"=>"birthdate", "value"=>false}, "phone_other"=>{"name"=>"phone_other", "value"=>""}, "c_accept_status_fields"=> {"name"=>"c_accept_status_fields", "value"=> " "}, "title"=>{"name"=>"title", "value"=>"VIP Operations"}, "campaign_id"=>{"name"=>"campaign_id", "value"=>""}, "primary_address_country"=> {"name"=>"primary_address_country", "value"=>"USA"}, "phone_fax"=>{"name"=>"phone_fax", "value"=>""}, "m_accept_status_fields"=> {"name"=>"m_accept_status_fields", "value"=> " "}, "alt_address_postalcode"=> {"name"=>"alt_address_postalcode", "value"=>""}, "opportunity_role_fields"=> {"name"=>"opportunity_role_fields", "value"=> " "}, "salutation"=>{"name"=>"salutation", "value"=>""}, "account_id"=> {"name"=>"account_id", "value"=>"a05fd10c-43fa-50cc-06e8-4d457eff371c"}, "report_to_name"=>{"name"=>"report_to_name", "value"=>""}, "date_modified"=> {"name"=>"date_modified", "value"=>"2011-01-31 19:52:32"}, "id"=>{"name"=>"id", "value"=>"111d8e29-9def-52ae-22b6-4d457e2bfc87"}, "portal_app"=>{"name"=>"portal_app", "value"=>""}, "created_by"=>{"name"=>"created_by", "value"=>"1"}, "modified_user_id"=>{"name"=>"modified_user_id", "value"=>"1"}, "deleted"=>{"name"=>"deleted", "value"=>"0"}, "alt_address_city"=>{"name"=>"alt_address_city", "value"=>""}, "portal_active"=>{"name"=>"portal_active", "value"=>"0"}, "email1"=>{"name"=>"email1", "value"=>"the.kid.kid@example.co.uk"}, "phone_home"=>{"name"=>"phone_home", "value"=>"(007) 125-2366"}, "phone_work"=>{"name"=>"phone_work", "value"=>"(061) 691-6482"}, "campaign_name"=>{"name"=>"campaign_name", "value"=>""}, "sid1_contact_type_contacts_name"=> {"name"=>"sid1_contact_type_contacts_name", "value"=>""}, "team_name"=>{"name"=>"team_name", "value"=>"West "}, "email2"=>{"name"=>"email2", "value"=>"the67@example.de"}, "team_set_id"=>{"name"=>"team_set_id", "value"=>"West"}, "assistant_phone"=>{"name"=>"assistant_phone", "value"=>""}, "created_by_name"=> {"name"=>"created_by_name", "value"=>"Sugar Administrator"}, "last_name"=>{"name"=>"last_name", "value"=>"Kanode"}, "reports_to_id"=>{"name"=>"reports_to_id", "value"=>""}, "alt_address_state"=>{"name"=>"alt_address_state", "value"=>""}, "portal_password"=>{"name"=>"portal_password", "value"=>""}, "modified_by_name"=> {"name"=>"modified_by_name", "value"=>"Sugar Administrator"}, "assigned_user_name"=> {"name"=>"assigned_user_name", "value"=>"Sarah Smith"}, "alt_address_street"=>{"name"=>"alt_address_street", "value"=>""}, "team_count"=>{"name"=>"team_count", "value"=>"1"}, "date_entered"=>{"name"=>"date_entered", "value"=>"2011-01-30 15:08:32"}, "description"=>{"name"=>"description", "value"=>""}, "assigned_user_id"=> {"name"=>"assigned_user_id", "value"=>"seed_sarah_id"}, "team_id"=>{"name"=>"team_id", "value"=>"West"}, "account_name"=>{"name"=>"account_name", "value"=>"P Piper & Sons"}, "department"=>{"name"=>"department", "value"=>""}, "lead_source"=>{"name"=>"lead_source", "value"=>"Cold Call"}, "first_name"=>{"name"=>"first_name", "value"=>"Tyron"}, "do_not_call"=>{"name"=>"do_not_call", "value"=>"0"}, "alt_address_country"=>{"name"=>"alt_address_country", "value"=>""}, "portal_name"=>{"name"=>"portal_name", "value"=>""}, "phone_mobile"=>{"name"=>"phone_mobile", "value"=>"(446) 080-9011"}, "assistant"=>{"name"=>"assistant", "value"=>""}, "picture"=>{"name"=>"picture", "value"=>""}}, "id"=>"111d8e29-9def-52ae-22b6-4d457e2bfc87", "module_name"=>"Contacts"}], "next_offset"=>1, "result_count"=>1, "relationship_list"=>[]}

get_entry_list: Request: { "session": "kmsr59lvmfn03481lq5kc105a0", "module_name": "Contacts", "query": "", "order_by": "id", "offset": "11", "select_fields": ["assigned_user_id","assistant_phone","phone_home","portal_password","date_modified","alt_address_postalcode","accept_status_id","team_set_id","picture","description","email1","title","primary_address_city","assigned_user_name","alt_address_state","reports_to_id","email2","report_to_name","portal_password1","primary_address_state","department","assistant","sync_contact","email_and_name1","team_name","accept_status_name","phone_mobile","portal_name","sid1_contact_type_contacts_name","c_accept_status_fields","account_name","portal_active","phone_other","alt_address_country","modified_by_name","last_name","alt_address_city","account_id","name","do_not_call","date_entered","team_count","m_accept_status_fields","birthdate","created_by_name","phone_fax","alt_address_street_2","campaign_name","deleted","salutation","alt_address_street_3","primary_address_street_2","invalid_email","primary_address_street_3","email_opt_out","modified_user_id","created_by","sid1_contact_types_contacts_name","first_name","portal_app","opportunity_role_fields","team_id","opportunity_role_id","opportunity_role","full_name","lead_source","primary_address_country","primary_address_postalcode","primary_address_street","alt_address_street","phone_work","id","campaign_id"], "link_name_to_fields_array": [], "max_results": "5", "deleted": 0 }

get_entry_list: JSON Response: {"entry_list"=> [{"name_value_list"=> {"primary_address_street"=> {"name"=>"primary_address_street", "value"=>"345 Sugar Blvd."}, "primary_address_postalcode"=> {"name"=>"primary_address_postalcode", "value"=>"18454"}, "modified_user_name"=> {"name"=>"modified_user_name", "value"=>"Sugar Administrator"}, "primary_address_state"=> {"name"=>"primary_address_state", "value"=>"CA"}, "primary_address_city"=> {"name"=>"primary_address_city", "value"=>"Cupertino"}, "sid1_contact_types_contacts_name"=> {"name"=>"sid1_contact_types_contacts_name", "value"=>""}, "birthdate"=>{"name"=>"birthdate", "value"=>false}, "phone_other"=>{"name"=>"phone_other", "value"=>""}, "c_accept_status_fields"=> {"name"=>"c_accept_status_fields", "value"=> " "}, "title"=>{"name"=>"title", "value"=>"Director Operations"}, "campaign_id"=>{"name"=>"campaign_id", "value"=>""}, "primary_address_country"=> {"name"=>"primary_address_country", "value"=>"USA"}, "phone_fax"=>{"name"=>"phone_fax", "value"=>""}, "m_accept_status_fields"=> {"name"=>"m_accept_status_fields", "value"=> " "}, "alt_address_postalcode"=> {"name"=>"alt_address_postalcode", "value"=>""}, "opportunity_role_fields"=> {"name"=>"opportunity_role_fields", "value"=> " "}, "salutation"=>{"name"=>"salutation", "value"=>""}, "account_id"=> {"name"=>"account_id", "value"=>"7c61c321-0136-f87b-a3b3-4d457eb62c4d"}, "report_to_name"=>{"name"=>"report_to_name", "value"=>""}, "date_modified"=> {"name"=>"date_modified", "value"=>"2011-01-30 15:08:33"}, "id"=>{"name"=>"id", "value"=>"1da8a4f9-cd43-3b9c-a62a-4d457e65809b"}, "portal_app"=>{"name"=>"portal_app", "value"=>""}, "created_by"=>{"name"=>"created_by", "value"=>"1"}, "modified_user_id"=>{"name"=>"modified_user_id", "value"=>"1"}, "deleted"=>{"name"=>"deleted", "value"=>"0"}, "alt_address_city"=>{"name"=>"alt_address_city", "value"=>""}, "portal_active"=>{"name"=>"portal_active", "value"=>"0"}, "email1"=> {"name"=>"email1", "value"=>"support.phone.section@example.com"}, "phone_home"=>{"name"=>"phone_home", "value"=>"(766) 308-4395"}, "phone_work"=>{"name"=>"phone_work", "value"=>"(051) 824-6643"}, "campaign_name"=>{"name"=>"campaign_name", "value"=>""}, "sid1_contact_type_contacts_name"=> {"name"=>"sid1_contact_type_contacts_name", "value"=>""}, "team_name"=>{"name"=>"team_name", "value"=>"West "}, "email2"=>{"name"=>"email2", "value"=>"info.sales@example.info"}, "team_set_id"=>{"name"=>"team_set_id", "value"=>"West"}, "assistant_phone"=>{"name"=>"assistant_phone", "value"=>""}, "created_by_name"=> {"name"=>"created_by_name", "value"=>"Sugar Administrator"}, "last_name"=>{"name"=>"last_name", "value"=>"Brennen"}, "reports_to_id"=>{"name"=>"reports_to_id", "value"=>""}, "alt_address_state"=>{"name"=>"alt_address_state", "value"=>""}, "portal_password"=>{"name"=>"portal_password", "value"=>""}, "modified_by_name"=> {"name"=>"modified_by_name", "value"=>"Sugar Administrator"}, "assigned_user_name"=> {"name"=>"assigned_user_name", "value"=>"Sarah Smith"}, "alt_address_street"=>{"name"=>"alt_address_street", "value"=>""}, "team_count"=>{"name"=>"team_count", "value"=>"1"}, "date_entered"=>{"name"=>"date_entered", "value"=>"2011-01-30 15:08:33"}, "description"=>{"name"=>"description", "value"=>""}, "assigned_user_id"=> {"name"=>"assigned_user_id", "value"=>"seed_sarah_id"}, "team_id"=>{"name"=>"team_id", "value"=>"West"}, "account_name"=>{"name"=>"account_name", "value"=>"A.G. Parr PLC"}, "department"=>{"name"=>"department", "value"=>""}, "lead_source"=>{"name"=>"lead_source", "value"=>"Cold Call"}, "first_name"=>{"name"=>"first_name", "value"=>"Fredric"}, "do_not_call"=>{"name"=>"do_not_call", "value"=>"0"}, "alt_address_country"=>{"name"=>"alt_address_country", "value"=>""}, "portal_name"=>{"name"=>"portal_name", "value"=>""}, "phone_mobile"=>{"name"=>"phone_mobile", "value"=>"(462) 264-0346"}, "assistant"=>{"name"=>"assistant", "value"=>""}, "picture"=>{"name"=>"picture", "value"=>""}}, "id"=>"1da8a4f9-cd43-3b9c-a62a-4d457e65809b", "module_name"=>"Contacts"}, {"name_value_list"=> {"primary_address_street"=> {"name"=>"primary_address_street", "value"=>"67321 West Siam St."}, "primary_address_postalcode"=> {"name"=>"primary_address_postalcode", "value"=>"65367"}, "modified_user_name"=> {"name"=>"modified_user_name", "value"=>"Sugar Administrator"}, "primary_address_state"=> {"name"=>"primary_address_state", "value"=>"CA"}, "primary_address_city"=> {"name"=>"primary_address_city", "value"=>"Santa Monica"}, "sid1_contact_types_contacts_name"=> {"name"=>"sid1_contact_types_contacts_name", "value"=>""}, "birthdate"=>{"name"=>"birthdate", "value"=>false}, "phone_other"=>{"name"=>"phone_other", "value"=>""}, "c_accept_status_fields"=> {"name"=>"c_accept_status_fields", "value"=> " "}, "title"=>{"name"=>"title", "value"=>"President"}, "campaign_id"=>{"name"=>"campaign_id", "value"=>""}, "primary_address_country"=> {"name"=>"primary_address_country", "value"=>"USA"}, "phone_fax"=>{"name"=>"phone_fax", "value"=>""}, "m_accept_status_fields"=> {"name"=>"m_accept_status_fields", "value"=> " "}, "alt_address_postalcode"=> {"name"=>"alt_address_postalcode", "value"=>""}, "opportunity_role_fields"=> {"name"=>"opportunity_role_fields", "value"=> " "}, "salutation"=>{"name"=>"salutation", "value"=>""}, "account_id"=> {"name"=>"account_id", "value"=>"923bc4ac-15ab-08dd-62f5-4d457eeba124"}, "report_to_name"=>{"name"=>"report_to_name", "value"=>""}, "date_modified"=> {"name"=>"date_modified", "value"=>"2011-01-30 15:08:32"}, "id"=>{"name"=>"id", "value"=>"1eff7e55-45dc-b09e-f5e7-4d457ece6160"}, "portal_app"=>{"name"=>"portal_app", "value"=>""}, "created_by"=>{"name"=>"created_by", "value"=>"1"}, "modified_user_id"=>{"name"=>"modified_user_id", "value"=>"1"}, "deleted"=>{"name"=>"deleted", "value"=>"0"}, "alt_address_city"=>{"name"=>"alt_address_city", "value"=>""}, "portal_active"=>{"name"=>"portal_active", "value"=>"0"}, "email1"=>{"name"=>"email1", "value"=>"sugar.hr@example.it"}, "phone_home"=>{"name"=>"phone_home", "value"=>"(678) 890-8111"}, "phone_work"=>{"name"=>"phone_work", "value"=>"(322) 432-3778"}, "campaign_name"=>{"name"=>"campaign_name", "value"=>""}, "sid1_contact_type_contacts_name"=> {"name"=>"sid1_contact_type_contacts_name", "value"=>""}, "team_name"=>{"name"=>"team_name", "value"=>"West "}, "email2"=>{"name"=>"email2", "value"=>"info82@example.org"}, "team_set_id"=> {"name"=>"team_set_id", "value"=>"867406b1-2c32-bb1c-6e81-4d457e3fbdb4"}, "assistant_phone"=>{"name"=>"assistant_phone", "value"=>""}, "created_by_name"=> {"name"=>"created_by_name", "value"=>"Sugar Administrator"}, "last_name"=>{"name"=>"last_name", "value"=>"Forgey"}, "reports_to_id"=>{"name"=>"reports_to_id", "value"=>""}, "alt_address_state"=>{"name"=>"alt_address_state", "value"=>""}, "portal_password"=>{"name"=>"portal_password", "value"=>""}, "modified_by_name"=> {"name"=>"modified_by_name", "value"=>"Sugar Administrator"}, "assigned_user_name"=> {"name"=>"assigned_user_name", "value"=>"Sarah Smith"}, "alt_address_street"=>{"name"=>"alt_address_street", "value"=>""}, "team_count"=>{"name"=>"team_count", "value"=>"3"}, "date_entered"=>{"name"=>"date_entered", "value"=>"2011-01-30 15:08:32"}, "description"=>{"name"=>"description", "value"=>""}, "assigned_user_id"=> {"name"=>"assigned_user_id", "value"=>"seed_sarah_id"}, "team_id"=>{"name"=>"team_id", "value"=>"West"}, "account_name"=>{"name"=>"account_name", "value"=>"360 Vacations"}, "department"=>{"name"=>"department", "value"=>""}, "lead_source"=>{"name"=>"lead_source", "value"=>"Other"}, "first_name"=>{"name"=>"first_name", "value"=>"Jeannie"}, "do_not_call"=>{"name"=>"do_not_call", "value"=>"0"}, "alt_address_country"=>{"name"=>"alt_address_country", "value"=>""}, "portal_name"=>{"name"=>"portal_name", "value"=>""}, "phone_mobile"=>{"name"=>"phone_mobile", "value"=>"(812) 683-0007"}, "assistant"=>{"name"=>"assistant", "value"=>""}, "picture"=>{"name"=>"picture", "value"=>""}}, "id"=>"1eff7e55-45dc-b09e-f5e7-4d457ece6160", "module_name"=>"Contacts"}, {"name_value_list"=> {"primary_address_street"=> {"name"=>"primary_address_street", "value"=>"9 IBM Path"}, "primary_address_postalcode"=> {"name"=>"primary_address_postalcode", "value"=>"58808"}, "modified_user_name"=> {"name"=>"modified_user_name", "value"=>"Sugar Administrator"}, "primary_address_state"=> {"name"=>"primary_address_state", "value"=>"CA"}, "primary_address_city"=> {"name"=>"primary_address_city", "value"=>"Persistance"}, "sid1_contact_types_contacts_name"=> {"name"=>"sid1_contact_types_contacts_name", "value"=>""}, "birthdate"=>{"name"=>"birthdate", "value"=>false}, "phone_other"=>{"name"=>"phone_other", "value"=>""}, "c_accept_status_fields"=> {"name"=>"c_accept_status_fields", "value"=> " "}, "title"=>{"name"=>"title", "value"=>"Director Operations"}, "campaign_id"=>{"name"=>"campaign_id", "value"=>""}, "primary_address_country"=> {"name"=>"primary_address_country", "value"=>"USA"}, "phone_fax"=>{"name"=>"phone_fax", "value"=>""}, "m_accept_status_fields"=> {"name"=>"m_accept_status_fields", "value"=> " "}, "alt_address_postalcode"=> {"name"=>"alt_address_postalcode", "value"=>""}, "opportunity_role_fields"=> {"name"=>"opportunity_role_fields", "value"=> " "}, "salutation"=>{"name"=>"salutation", "value"=>""}, "account_id"=> {"name"=>"account_id", "value"=>"cc7e79c3-7fea-ac83-d546-4d457e6b7841"}, "report_to_name"=>{"name"=>"report_to_name", "value"=>""}, "date_modified"=> {"name"=>"date_modified", "value"=>"2011-01-30 15:08:30"}, "id"=>{"name"=>"id", "value"=>"201cba16-1ea5-9d50-21fd-4d457ea23076"}, "portal_app"=>{"name"=>"portal_app", "value"=>""}, "created_by"=>{"name"=>"created_by", "value"=>"1"}, "modified_user_id"=>{"name"=>"modified_user_id", "value"=>"1"}, "deleted"=>{"name"=>"deleted", "value"=>"0"}, "alt_address_city"=>{"name"=>"alt_address_city", "value"=>""}, "portal_active"=>{"name"=>"portal_active", "value"=>"0"}, "email1"=>{"name"=>"email1", "value"=>"support63@example.edu"}, "phone_home"=>{"name"=>"phone_home", "value"=>"(451) 161-1069"}, "phone_work"=>{"name"=>"phone_work", "value"=>"(243) 625-0053"}, "campaign_name"=>{"name"=>"campaign_name", "value"=>""}, "sid1_contact_type_contacts_name"=> {"name"=>"sid1_contact_type_contacts_name", "value"=>""}, "team_name"=>{"name"=>"team_name", "value"=>"West "}, "email2"=> {"name"=>"email2", "value"=>"beans.section.support@example.org"}, "team_set_id"=>{"name"=>"team_set_id", "value"=>"West"}, "assistant_phone"=>{"name"=>"assistant_phone", "value"=>""}, "created_by_name"=> {"name"=>"created_by_name", "value"=>"Sugar Administrator"}, "last_name"=>{"name"=>"last_name", "value"=>"Crumb"}, "reports_to_id"=>{"name"=>"reports_to_id", "value"=>""}, "alt_address_state"=>{"name"=>"alt_address_state", "value"=>""}, "portal_password"=>{"name"=>"portal_password", "value"=>""}, "modified_by_name"=> {"name"=>"modified_by_name", "value"=>"Sugar Administrator"}, "assigned_user_name"=> {"name"=>"assigned_user_name", "value"=>"Sally Bronsen"}, "alt_address_street"=>{"name"=>"alt_address_street", "value"=>""}, "team_count"=>{"name"=>"team_count", "value"=>"1"}, "date_entered"=>{"name"=>"date_entered", "value"=>"2011-01-30 15:08:30"}, "description"=>{"name"=>"description", "value"=>""}, "assigned_user_id"=> {"name"=>"assigned_user_id", "value"=>"seed_sally_id"}, "team_id"=>{"name"=>"team_id", "value"=>"West"}, "account_name"=>{"name"=>"account_name", "value"=>"B.H. Edwards Inc"}, "department"=>{"name"=>"department", "value"=>""}, "lead_source"=>{"name"=>"lead_source", "value"=>"Campaign"}, "first_name"=>{"name"=>"first_name", "value"=>"Rosalind"}, "do_not_call"=>{"name"=>"do_not_call", "value"=>"0"}, "alt_address_country"=>{"name"=>"alt_address_country", "value"=>""}, "portal_name"=>{"name"=>"portal_name", "value"=>""}, "phone_mobile"=>{"name"=>"phone_mobile", "value"=>"(852) 017-0839"}, "assistant"=>{"name"=>"assistant", "value"=>""}, "picture"=>{"name"=>"picture", "value"=>""}}, "id"=>"201cba16-1ea5-9d50-21fd-4d457ea23076", "module_name"=>"Contacts"}, {"name_value_list"=> {"primary_address_street"=> {"name"=>"primary_address_street", "value"=>"123 Anywhere Street"}, "primary_address_postalcode"=> {"name"=>"primary_address_postalcode", "value"=>"29211"}, "modified_user_name"=> {"name"=>"modified_user_name", "value"=>"Sugar Administrator"}, "primary_address_state"=> {"name"=>"primary_address_state", "value"=>"CA"}, "primary_address_city"=> {"name"=>"primary_address_city", "value"=>"St. Petersburg"}, "sid1_contact_types_contacts_name"=> {"name"=>"sid1_contact_types_contacts_name", "value"=>""}, "birthdate"=>{"name"=>"birthdate", "value"=>false}, "phone_other"=>{"name"=>"phone_other", "value"=>""}, "c_accept_status_fields"=> {"name"=>"c_accept_status_fields", "value"=> " "}, "title"=>{"name"=>"title", "value"=>"Senior Product Manager"}, "campaign_id"=>{"name"=>"campaign_id", "value"=>""}, "primary_address_country"=> {"name"=>"primary_address_country", "value"=>"USA"}, "phone_fax"=>{"name"=>"phone_fax", "value"=>""}, "m_accept_status_fields"=> {"name"=>"m_accept_status_fields", "value"=> " "}, "alt_address_postalcode"=> {"name"=>"alt_address_postalcode", "value"=>""}, "opportunity_role_fields"=> {"name"=>"opportunity_role_fields", "value"=> " "}, "salutation"=>{"name"=>"salutation", "value"=>""}, "account_id"=> {"name"=>"account_id", "value"=>"f20af19e-f218-3269-12d0-4d457e2a4b16"}, "report_to_name"=>{"name"=>"report_to_name", "value"=>""}, "date_modified"=> {"name"=>"date_modified", "value"=>"2011-01-30 15:08:33"}, "id"=>{"name"=>"id", "value"=>"2248009b-6851-44f5-0c5f-4d457ef8f53b"}, "portal_app"=>{"name"=>"portal_app", "value"=>""}, "created_by"=>{"name"=>"created_by", "value"=>"1"}, "modified_user_id"=>{"name"=>"modified_user_id", "value"=>"1"}, "deleted"=>{"name"=>"deleted", "value"=>"0"}, "alt_address_city"=>{"name"=>"alt_address_city", "value"=>""}, "portal_active"=>{"name"=>"portal_active", "value"=>"0"}, "email1"=>{"name"=>"email1", "value"=>"info.sugar@example.us"}, "phone_home"=>{"name"=>"phone_home", "value"=>"(252) 463-5816"}, "phone_work"=>{"name"=>"phone_work", "value"=>"(673) 931-8741"}, "campaign_name"=>{"name"=>"campaign_name", "value"=>""}, "sid1_contact_type_contacts_name"=> {"name"=>"sid1_contact_type_contacts_name", "value"=>""}, "team_name"=>{"name"=>"team_name", "value"=>"West "}, "email2"=>{"name"=>"email2", "value"=>"support63@example.us"}, "team_set_id"=> {"name"=>"team_set_id", "value"=>"867406b1-2c32-bb1c-6e81-4d457e3fbdb4"}, "assistant_phone"=>{"name"=>"assistant_phone", "value"=>""}, "created_by_name"=> {"name"=>"created_by_name", "value"=>"Sugar Administrator"}, "last_name"=>{"name"=>"last_name", "value"=>"Teed"}, "reports_to_id"=>{"name"=>"reports_to_id", "value"=>""}, "alt_address_state"=>{"name"=>"alt_address_state", "value"=>""}, "portal_password"=>{"name"=>"portal_password", "value"=>""}, "modified_by_name"=> {"name"=>"modified_by_name", "value"=>"Sugar Administrator"}, "assigned_user_name"=> {"name"=>"assigned_user_name", "value"=>"Sarah Smith"}, "alt_address_street"=>{"name"=>"alt_address_street", "value"=>""}, "team_count"=>{"name"=>"team_count", "value"=>"3"}, "date_entered"=>{"name"=>"date_entered", "value"=>"2011-01-30 15:08:33"}, "description"=>{"name"=>"description", "value"=>""}, "assigned_user_id"=> {"name"=>"assigned_user_id", "value"=>"seed_sarah_id"}, "team_id"=>{"name"=>"team_id", "value"=>"West"}, "account_name"=>{"name"=>"account_name", "value"=>"AB Drivers Limited"}, "department"=>{"name"=>"department", "value"=>""}, "lead_source"=>{"name"=>"lead_source", "value"=>"Cold Call"}, "first_name"=>{"name"=>"first_name", "value"=>"Jamar"}, "do_not_call"=>{"name"=>"do_not_call", "value"=>"0"}, "alt_address_country"=>{"name"=>"alt_address_country", "value"=>""}, "portal_name"=>{"name"=>"portal_name", "value"=>""}, "phone_mobile"=>{"name"=>"phone_mobile", "value"=>"(755) 306-4583"}, "assistant"=>{"name"=>"assistant", "value"=>""}, "picture"=>{"name"=>"picture", "value"=>""}}, "id"=>"2248009b-6851-44f5-0c5f-4d457ef8f53b", "module_name"=>"Contacts"}, {"name_value_list"=> {"primary_address_street"=> {"name"=>"primary_address_street", "value"=>"67321 West Siam St."}, "primary_address_postalcode"=> {"name"=>"primary_address_postalcode", "value"=>"11116"}, "modified_user_name"=> {"name"=>"modified_user_name", "value"=>"Sugar Administrator"}, "primary_address_state"=> {"name"=>"primary_address_state", "value"=>"CA"}, "primary_address_city"=> {"name"=>"primary_address_city", "value"=>"St. Petersburg"}, "sid1_contact_types_contacts_name"=> {"name"=>"sid1_contact_types_contacts_name", "value"=>""}, "birthdate"=>{"name"=>"birthdate", "value"=>false}, "phone_other"=>{"name"=>"phone_other", "value"=>""}, "c_accept_status_fields"=> {"name"=>"c_accept_status_fields", "value"=> " "}, "title"=>{"name"=>"title", "value"=>"Senior Product Manager"}, "campaign_id"=>{"name"=>"campaign_id", "value"=>""}, "primary_address_country"=> {"name"=>"primary_address_country", "value"=>"USA"}, "phone_fax"=>{"name"=>"phone_fax", "value"=>""}, "m_accept_status_fields"=> {"name"=>"m_accept_status_fields", "value"=> " "}, "alt_address_postalcode"=> {"name"=>"alt_address_postalcode", "value"=>""}, "opportunity_role_fields"=> {"name"=>"opportunity_role_fields", "value"=> " "}, "salutation"=>{"name"=>"salutation", "value"=>""}, "account_id"=> {"name"=>"account_id", "value"=>"7c61c321-0136-f87b-a3b3-4d457eb62c4d"}, "report_to_name"=>{"name"=>"report_to_name", "value"=>""}, "date_modified"=> {"name"=>"date_modified", "value"=>"2011-01-30 15:08:32"}, "id"=>{"name"=>"id", "value"=>"232b3f0c-65b5-ee68-cbaf-4d457e258089"}, "portal_app"=>{"name"=>"portal_app", "value"=>""}, "created_by"=>{"name"=>"created_by", "value"=>"1"}, "modified_user_id"=>{"name"=>"modified_user_id", "value"=>"1"}, "deleted"=>{"name"=>"deleted", "value"=>"0"}, "alt_address_city"=>{"name"=>"alt_address_city", "value"=>""}, "portal_active"=>{"name"=>"portal_active", "value"=>"0"}, "email1"=>{"name"=>"email1", "value"=>"sales.the@example.name"}, "phone_home"=>{"name"=>"phone_home", "value"=>"(336) 471-9385"}, "phone_work"=>{"name"=>"phone_work", "value"=>"(426) 785-0180"}, "campaign_name"=>{"name"=>"campaign_name", "value"=>""}, "sid1_contact_type_contacts_name"=> {"name"=>"sid1_contact_type_contacts_name", "value"=>""}, "team_name"=>{"name"=>"team_name", "value"=>"West "}, "email2"=>{"name"=>"email2", "value"=>"sugar33@example.com"}, "team_set_id"=>{"name"=>"team_set_id", "value"=>"West"}, "assistant_phone"=>{"name"=>"assistant_phone", "value"=>""}, "created_by_name"=> {"name"=>"created_by_name", "value"=>"Sugar Administrator"}, "last_name"=>{"name"=>"last_name", "value"=>"Frates"}, "reports_to_id"=>{"name"=>"reports_to_id", "value"=>""}, "alt_address_state"=>{"name"=>"alt_address_state", "value"=>""}, "portal_password"=>{"name"=>"portal_password", "value"=>""}, "modified_by_name"=> {"name"=>"modified_by_name", "value"=>"Sugar Administrator"}, "assigned_user_name"=> {"name"=>"assigned_user_name", "value"=>"Sarah Smith"}, "alt_address_street"=>{"name"=>"alt_address_street", "value"=>""}, "team_count"=>{"name"=>"team_count", "value"=>"1"}, "date_entered"=>{"name"=>"date_entered", "value"=>"2011-01-30 15:08:32"}, "description"=>{"name"=>"description", "value"=>""}, "assigned_user_id"=> {"name"=>"assigned_user_id", "value"=>"seed_sarah_id"}, "team_id"=>{"name"=>"team_id", "value"=>"West"}, "account_name"=>{"name"=>"account_name", "value"=>"A.G. Parr PLC"}, "department"=>{"name"=>"department", "value"=>""}, "lead_source"=>{"name"=>"lead_source", "value"=>"Email"}, "first_name"=>{"name"=>"first_name", "value"=>"Duane"}, "do_not_call"=>{"name"=>"do_not_call", "value"=>"0"}, "alt_address_country"=>{"name"=>"alt_address_country", "value"=>""}, "portal_name"=>{"name"=>"portal_name", "value"=>""}, "phone_mobile"=>{"name"=>"phone_mobile", "value"=>"(146) 857-4958"}, "assistant"=>{"name"=>"assistant", "value"=>""}, "picture"=>{"name"=>"picture", "value"=>""}}, "id"=>"232b3f0c-65b5-ee68-cbaf-4d457e258089", "module_name"=>"Contacts"}], "next_offset"=>16, "result_count"=>5, "relationship_list"=>[]}

get_module_fields: Request: { "session": "kmsr59lvmfn03481lq5kc105a0", "module_name": "Opportunities" }

get_module_fields: JSON Response: {"module_fields"=> {"name"=> {"required"=>1, "label"=>"Opportunity Name:", "name"=>"name", "type"=>"name", "options"=>[]}, "currency_id"=> {"required"=>0, "label"=>"Currency:", "name"=>"currency_id", "type"=>"id", "options"=>[]}, "campaign_id"=> {"required"=>0, "label"=>"campaign_id", "name"=>"campaign_id", "type"=>"id", "options"=>[]}, "sales_stage"=> {"required"=>1, "label"=>"Sales Stage:", "name"=>"sales_stage", "type"=>"enum", "options"=> {"Value Proposition"=> {"name"=>"Value Proposition", "value"=>"Value Proposition"}, "Needs Analysis"=>{"name"=>"Needs Analysis", "value"=>"Needs Analysis"}, "Proposal/Price Quote"=> {"name"=>"Proposal/Price Quote", "value"=>"Proposal/Price Quote"}, "Closed Lost"=>{"name"=>"Closed Lost", "value"=>"Closed Lost"}, "Closed Won"=>{"name"=>"Closed Won", "value"=>"Closed Won"}, "Prospecting"=>{"name"=>"Prospecting", "value"=>"Prospecting"}, "Perception Analysis"=> {"name"=>"Perception Analysis", "value"=>"Perception Analysis"}, "Negotiation/Review"=> {"name"=>"Negotiation/Review", "value"=>"Negotiation/Review"}, "Qualification"=>{"name"=>"Qualification", "value"=>"Qualification"}, "Id. Decision Makers"=> {"name"=>"Id. Decision Makers", "value"=>"Id. Decision Makers"}}}, "amount"=> {"required"=>1, "label"=>"Opportunity Amount:", "name"=>"amount", "type"=>"currency", "options"=>[]}, "account_id"=> {"required"=>0, "label"=>"Account ID", "name"=>"account_id", "type"=>"id", "options"=>[]}, "date_modified"=> {"required"=>0, "label"=>"Date Modified", "name"=>"date_modified", "type"=>"datetime", "options"=>[]}, "deleted"=> {"required"=>0, "label"=>"Deleted", "name"=>"deleted", "default_value"=>"0", "type"=>"bool", "options"=>[]}, "created_by"=> {"required"=>0, "label"=>"Created By", "name"=>"created_by", "type"=>"assigned_user_name", "options"=>[]}, "modified_user_id"=> {"required"=>0, "label"=>"Modified By", "name"=>"modified_user_id", "type"=>"assigned_user_name", "options"=>[]}, "id"=> {"required"=>1, "label"=>"ID", "name"=>"id", "type"=>"id", "options"=>[]}, "next_step"=> {"required"=>0, "label"=>"Next Step:", "name"=>"next_step", "type"=>"varchar", "options"=>[]}, "campaign_name"=> {"required"=>0, "label"=>"Campaign:", "name"=>"campaign_name", "type"=>"relate", "options"=>[]}, "team_name"=> {"required"=>0, "label"=>"Teams", "name"=>"team_name", "type"=>"relate", "options"=>[]}, "team_set_id"=> {"required"=>0, "label"=>"Team Set ID", "name"=>"team_set_id", "type"=>"id", "options"=>[]}, "created_by_name"=> {"required"=>0, "label"=>"Created By", "name"=>"created_by_name", "type"=>"assigned_user_name", "options"=>[]}, "currency_name"=> {"required"=>0, "label"=>"Currency Name", "name"=>"currency_name", "type"=>"relate", "options"=>[]}, "assigned_user_name"=> {"required"=>0, "label"=>"Assigned to:", "name"=>"assigned_user_name", "type"=>"relate", "options"=>[]}, "modified_by_name"=> {"required"=>0, "label"=>"Modified By", "name"=>"modified_by_name", "type"=>"assigned_user_name", "options"=>[]}, "currency_symbol"=> {"required"=>0, "label"=>"Currency Symbol", "name"=>"currency_symbol", "type"=>"relate", "options"=>[]}, "opportunity_type"=> {"required"=>0, "label"=>"Type:", "name"=>"opportunity_type", "type"=>"enum", "options"=> {"New Business"=>{"name"=>"New Business", "value"=>"New Business"}, ""=>{"name"=>"", "value"=>""}, "Existing Business"=> {"name"=>"Existing Business", "value"=>"Existing Business"}}}, "team_count"=> {"required"=>0, "label"=>"Teams", "name"=>"team_count", "type"=>"relate", "options"=>[]}, "assigned_user_id"=> {"required"=>0, "label"=>"Assigned User:", "name"=>"assigned_user_id", "type"=>"relate",

frugardc commented 13 years ago

Here is the output from a failure doing the association from the other way ( Opportunity to custom ContactType module)

Loaded suite unit/sugar_contact_type_test Started get_module_fields: Request: { "session": "9qdsuriq4c2sgo1sur53bhllp0", "module_name": "sid1_contact_types" }

get_module_fields: JSON Response: {"module_fields"=> {"types_c"=> {"required"=>1, "label"=>"Types", "name"=>"types_c", "type"=>"multienum", "options"=> {"a_loc"=>{"name"=>"a_loc", "value"=>"A Loc"}, "z_loc"=>{"name"=>"z_loc", "value"=>"Z Loc"}}}, "name"=> {"required"=>0, "label"=>"Name", "name"=>"name", "type"=>"name", "options"=>[]}, "contacts_sid1_contact_types_name"=> {"required"=>0, "label"=>"Contacts", "name"=>"contacts_sid1_contact_types_name", "type"=>"relate", "options"=>[]}, "date_modified"=> {"required"=>0, "label"=>"Date Modified", "name"=>"date_modified", "type"=>"datetime", "options"=>[]}, "deleted"=> {"required"=>0, "label"=>"Deleted", "name"=>"deleted", "default_value"=>"0", "type"=>"bool", "options"=>[]}, "created_by"=> {"required"=>0, "label"=>"Created By", "name"=>"created_by", "type"=>"assigned_user_name", "options"=>[]}, "modified_user_id"=> {"required"=>0, "label"=>"Modified By", "name"=>"modified_user_id", "type"=>"assigned_user_name", "options"=>[]}, "id"=> {"required"=>1, "label"=>"ID", "name"=>"id", "type"=>"id", "options"=>[]}, "team_name"=> {"required"=>0, "label"=>"Teams", "name"=>"team_name", "type"=>"relate", "options"=>[]}, "team_set_id"=> {"required"=>0, "label"=>"Team Set ID", "name"=>"team_set_id", "type"=>"id", "options"=>[]}, "created_by_name"=> {"required"=>0, "label"=>"Created By", "name"=>"created_by_name", "type"=>"assigned_user_name", "options"=>[]}, "assigned_user_name"=> {"required"=>0, "label"=>"User", "name"=>"assigned_user_name", "type"=>"relate", "options"=>[]}, "modified_by_name"=> {"required"=>0, "label"=>"Modified By", "name"=>"modified_by_name", "type"=>"assigned_user_name", "options"=>[]}, "assigned_user_id"=> {"required"=>0, "label"=>"Assigned User Id", "name"=>"assigned_user_id", "type"=>"relate", "options"=>[]}, "team_count"=> {"required"=>0, "label"=>"Teams", "name"=>"team_count", "type"=>"relate", "options"=>[]}, "description"=> {"required"=>0, "label"=>"Description", "name"=>"description", "type"=>"text", "options"=>[]}, "date_entered"=> {"required"=>0, "label"=>"Date Created", "name"=>"date_entered", "type"=>"datetime", "options"=>[]}, "team_id"=> {"required"=>0, "label"=>"Team Id", "name"=>"team_id", "type"=>"team_list", "options"=>[]}, "opportunities_sid1_contact_types_name"=> {"required"=>0, "label"=>"Opportunities", "name"=>"opportunities_sid1_contact_types_name", "type"=>"relate", "options"=>[]}}, "module_name"=>"sid1_contact_types", "link_fields"=> {"opportunit8131unities_ida"=> {"name"=>"opportunit8131unities_ida", "module"=>"", "bean_name"=>"", "relationship"=>"opportunities_sid1_contact_types", "type"=>"link"}, "teams"=> {"name"=>"teams", "module"=>"", "bean_name"=>"", "relationship"=>"sid1_contact_types_teams", "type"=>"link"}, "opportunities_sid1_contact_types"=> {"name"=>"opportunities_sid1_contact_types", "module"=>"", "bean_name"=>"", "relationship"=>"opportunities_sid1_contact_types", "type"=>"link"}, "contacts_s9ccaontacts_ida"=> {"name"=>"contacts_s9ccaontacts_ida", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_sid1_contact_types", "type"=>"link"}, "team_count_link"=> {"name"=>"team_count_link", "module"=>"Teams", "bean_name"=>"TeamSet", "relationship"=>"sid1_contact_types_team_count_relationship", "type"=>"link"}, "modified_user_link"=> {"name"=>"modified_user_link", "module"=>"Users", "bean_name"=>"User", "relationship"=>"sid1_contact_types_modified_user", "type"=>"link"}, "created_by_link"=> {"name"=>"created_by_link", "module"=>"Users", "bean_name"=>"User", "relationship"=>"sid1_contact_types_created_by", "type"=>"link"}, "team_link"=> {"name"=>"team_link", "module"=>"Teams", "bean_name"=>"Team", "relationship"=>"sid1_contact_types_team", "type"=>"link"}, "assigned_user_link"=> {"name"=>"assigned_user_link", "module"=>"Users", "bean_name"=>"User", "relationship"=>"sid1_contact_types_assigned_user", "type"=>"link"}, "contacts_sid1_contact_types"=> {"name"=>"contacts_sid1_contact_types", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_sid1_contact_types", "type"=>"link"}}}

set_entry: Request: { "session": "9qdsuriq4c2sgo1sur53bhllp0", "module_name": "sid1_contact_types", "name_value_list": {"types_c":{"name":"types_c","value":"z_loc"}} }

set_entry: JSON Response: {"id"=>"768352f1-781b-decc-af69-4d480e1d3722"}

768352f1-781b-decc-af69-4d480e1d3722 get_module_fields: Request: { "session": "9qdsuriq4c2sgo1sur53bhllp0", "module_name": "Contacts" }

get_module_fields: JSON Response: {"module_fields"=> {"assigned_user_id"=> {"required"=>0, "label"=>"Assigned User", "name"=>"assigned_user_id", "type"=>"relate", "options"=>[]}, "assistant_phone"=> {"required"=>0, "label"=>"Assistant Phone:", "name"=>"assistant_phone", "type"=>"phone", "options"=>[]}, "phone_home"=> {"required"=>0, "label"=>"Home:", "name"=>"phone_home", "type"=>"phone", "options"=>[]}, "portal_password"=> {"required"=>0, "label"=>"Password:", "name"=>"portal_password", "type"=>"varchar", "options"=>[]}, "date_modified"=> {"required"=>0, "label"=>"Date Modified:", "name"=>"date_modified", "type"=>"datetime", "options"=>[]}, "alt_address_postalcode"=> {"required"=>0, "label"=>"Alternate Address Postal Code:", "name"=>"alt_address_postalcode", "type"=>"varchar", "options"=>[]}, "accept_status_id"=> {"required"=>0, "label"=>"Accept Status", "name"=>"accept_status_id", "type"=>"varchar", "options"=>[]}, "team_set_id"=> {"required"=>0, "label"=>"Team Set ID", "name"=>"team_set_id", "type"=>"id", "options"=>[]}, "picture"=> {"required"=>0, "label"=>"Picture", "name"=>"picture", "type"=>"image", "options"=>[]}, "description"=> {"required"=>0, "label"=>"Description:", "name"=>"description", "type"=>"text", "options"=>[]}, "email1"=> {"required"=>0, "label"=>"Email Address:", "name"=>"email1", "type"=>"varchar", "options"=>[]}, "title"=> {"required"=>0, "label"=>"Title:", "name"=>"title", "type"=>"varchar", "options"=>[]}, "primary_address_city"=> {"required"=>0, "label"=>"Primary Address City:", "name"=>"primary_address_city", "type"=>"varchar", "options"=>[]}, "assigned_user_name"=> {"required"=>0, "label"=>"Assigned to:", "name"=>"assigned_user_name", "type"=>"relate", "options"=>[]}, "alt_address_state"=> {"required"=>0, "label"=>"Alternate Address State:", "name"=>"alt_address_state", "type"=>"varchar", "options"=>[]}, "reports_to_id"=> {"required"=>0, "label"=>"Reports to ID:", "name"=>"reports_to_id", "type"=>"id", "options"=>[]}, "email2"=> {"required"=>0, "label"=>"Other Email:", "name"=>"email2", "type"=>"varchar", "options"=>[]}, "report_to_name"=> {"required"=>0, "label"=>"Reports To:", "name"=>"report_to_name", "type"=>"relate", "options"=>[]}, "portal_password1"=> {"required"=>0, "label"=>"Password:", "name"=>"portal_password1", "type"=>"varchar", "options"=>[]}, "primary_address_state"=> {"required"=>0, "label"=>"Primary Address State:", "name"=>"primary_address_state", "type"=>"varchar", "options"=>[]}, "department"=> {"required"=>0, "label"=>"Department:", "name"=>"department", "type"=>"varchar", "options"=>[]}, "sync_contact"=> {"required"=>0, "label"=>"Sync to Outlook®:", "name"=>"sync_contact", "type"=>"bool", "options"=>[]}, "accept_status_name"=> {"required"=>0, "label"=>"Accept Status", "name"=>"accept_status_name", "type"=>"enum", "options"=> {"accept"=>{"name"=>"accept", "value"=>"Accepted"}, "none"=>{"name"=>"none", "value"=>"None"}, "tentative"=>{"name"=>"tentative", "value"=>"Tentative"}, "decline"=>{"name"=>"decline", "value"=>"Declined"}}}, "assistant"=> {"required"=>0, "label"=>"Assistant:", "name"=>"assistant", "type"=>"varchar", "options"=>[]}, "email_and_name1"=> {"required"=>0, "label"=>"Name:", "name"=>"email_and_name1", "type"=>"varchar", "options"=>[]}, "team_name"=> {"required"=>0, "label"=>"Teams", "name"=>"team_name", "type"=>"relate", "options"=>[]}, "sid1_contact_type_contacts_name"=> {"required"=>0, "label"=>"Contact Types", "name"=>"sid1_contact_type_contacts_name", "type"=>"relate", "options"=>[]}, "c_accept_status_fields"=> {"required"=>0, "label"=>"Accept Status", "name"=>"c_accept_status_fields", "type"=>"relate", "options"=>[]}, "phone_mobile"=> {"required"=>0, "label"=>"Mobile:", "name"=>"phone_mobile", "type"=>"phone", "options"=>[]}, "portal_name"=> {"required"=>0, "label"=>"Portal Name:", "name"=>"portal_name", "type"=>"varchar", "options"=>[]}, "account_name"=> {"required"=>0, "label"=>"Account Name:", "name"=>"account_name", "type"=>"relate", "options"=>[]}, "portal_active"=> {"required"=>0, "label"=>"Portal Active:", "name"=>"portal_active", "default_value"=>"0", "type"=>"bool", "options"=>[]}, "phone_other"=> {"required"=>0, "label"=>"Other Phone:", "name"=>"phone_other", "type"=>"phone", "options"=>[]}, "alt_address_country"=> {"required"=>0, "label"=>"Alternate Address Country:", "name"=>"alt_address_country", "type"=>"varchar", "options"=>[]}, "modified_by_name"=> {"required"=>0, "label"=>"Modified By:", "name"=>"modified_by_name", "type"=>"assigned_user_name", "options"=>[]}, "last_name"=> {"required"=>1, "label"=>"Last Name:", "name"=>"last_name", "type"=>"varchar", "options"=>[]}, "alt_address_city"=> {"required"=>0, "label"=>"Alternate Address City:", "name"=>"alt_address_city", "type"=>"varchar", "options"=>[]}, "account_id"=> {"required"=>0, "label"=>"Account ID:", "name"=>"account_id", "type"=>"relate", "options"=>[]}, "name"=> {"required"=>0, "label"=>"Name:", "name"=>"name", "type"=>"name", "options"=>[]}, "m_accept_status_fields"=> {"required"=>0, "label"=>"Accept Status", "name"=>"m_accept_status_fields", "type"=>"relate", "options"=>[]}, "do_not_call"=> {"required"=>0, "label"=>"Do Not Call:", "name"=>"do_not_call", "default_value"=>"0", "type"=>"bool", "options"=>[]}, "date_entered"=> {"required"=>0, "label"=>"Date Created", "name"=>"date_entered", "type"=>"datetime", "options"=>[]}, "team_count"=> {"required"=>0, "label"=>"Teams", "name"=>"team_count", "type"=>"relate", "options"=>[]}, "birthdate"=> {"required"=>0, "label"=>"Birthdate:", "name"=>"birthdate", "type"=>"date", "options"=>[]}, "created_by_name"=> {"required"=>0, "label"=>"Created By", "name"=>"created_by_name", "type"=>"assigned_user_name", "options"=>[]}, "phone_fax"=> {"required"=>0, "label"=>"Fax:", "name"=>"phone_fax", "type"=>"phone", "options"=>[]}, "alt_address_street_2"=> {"required"=>0, "label"=>"Alternate Address Street 2:", "name"=>"alt_address_street_2", "type"=>"varchar", "options"=>[]}, "campaign_name"=> {"required"=>0, "label"=>"Campaign:", "name"=>"campaign_name", "type"=>"relate", "options"=>[]}, "deleted"=> {"required"=>0, "label"=>"Deleted", "name"=>"deleted", "default_value"=>"0", "type"=>"bool", "options"=>[]}, "salutation"=> {"required"=>0, "label"=>"Salutation:", "name"=>"salutation", "type"=>"enum", "options"=> {"Dr."=>{"name"=>"Dr.", "value"=>"Dr."}, "Mrs."=>{"name"=>"Mrs.", "value"=>"Mrs."}, ""=>{"name"=>"", "value"=>""}, "Ms."=>{"name"=>"Ms.", "value"=>"Ms."}, "Mr."=>{"name"=>"Mr.", "value"=>"Mr."}, "Prof."=>{"name"=>"Prof.", "value"=>"Prof."}}}, "alt_address_street_3"=> {"required"=>0, "label"=>"Alternate Address Street 3:", "name"=>"alt_address_street_3", "type"=>"varchar", "options"=>[]}, "primary_address_street_2"=> {"required"=>0, "label"=>"Primary Address Street 2:", "name"=>"primary_address_street_2", "type"=>"varchar", "options"=>[]}, "invalid_email"=> {"required"=>0, "label"=>"Invalid Email:", "name"=>"invalid_email", "type"=>"bool", "options"=>[]}, "primary_address_street_3"=> {"required"=>0, "label"=>"Primary Address Street 3:", "name"=>"primary_address_street_3", "type"=>"varchar", "options"=>[]}, "email_opt_out"=> {"required"=>0, "label"=>"Email Opt Out:", "name"=>"email_opt_out", "type"=>"bool", "options"=>[]}, "sid1_contact_types_contacts_name"=> {"required"=>0, "label"=>"Contact Types", "name"=>"sid1_contact_types_contacts_name", "type"=>"relate", "options"=>[]}, "modified_user_id"=> {"required"=>0, "label"=>"Modified By:", "name"=>"modified_user_id", "type"=>"assigned_user_name", "options"=>[]}, "created_by"=> {"required"=>0, "label"=>"Created By", "name"=>"created_by", "type"=>"assigned_user_name", "options"=>[]}, "first_name"=> {"required"=>0, "label"=>"First Name:", "name"=>"first_name", "type"=>"varchar", "options"=>[]}, "portal_app"=> {"required"=>0, "label"=>"Portal Application:", "name"=>"portal_app", "type"=>"varchar", "options"=>[]}, "opportunity_role_fields"=> {"required"=>0, "label"=>"Account Name:", "name"=>"opportunity_role_fields", "type"=>"relate", "options"=>[]}, "team_id"=> {"required"=>0, "label"=>"Team ID:", "name"=>"team_id", "type"=>"team_list", "options"=>[]}, "opportunity_role_id"=> {"required"=>0, "label"=>"Opportunity Role ID:", "name"=>"opportunity_role_id", "type"=>"varchar", "options"=>[]}, "opportunity_role"=> {"required"=>0, "label"=>"Opportunity Role", "name"=>"opportunity_role", "type"=>"enum", "options"=> {""=>{"name"=>"", "value"=>""}, "Primary Decision Maker"=> {"name"=>"Primary Decision Maker", "value"=>"Primary Decision Maker"}, "Business Decision Maker"=> {"name"=>"Business Decision Maker", "value"=>"Business Decision Maker"}, "Technical Evaluator"=> {"name"=>"Technical Evaluator", "value"=>"Technical Evaluator"}, "Executive Sponsor"=> {"name"=>"Executive Sponsor", "value"=>"Executive Sponsor"}, "Business Evaluator"=> {"name"=>"Business Evaluator", "value"=>"Business Evaluator"}, "Technical Decision Maker"=> {"name"=>"Technical Decision Maker", "value"=>"Technical Decision Maker"}, "Other"=>{"name"=>"Other", "value"=>"Other"}, "Influencer"=>{"name"=>"Influencer", "value"=>"Influencer"}}}, "lead_source"=> {"required"=>0, "label"=>"Lead Source:", "name"=>"lead_source", "type"=>"enum", "options"=> {"Word of mouth"=>{"name"=>"Word of mouth", "value"=>"Word of mouth"}, ""=>{"name"=>"", "value"=>""}, "Partner"=>{"name"=>"Partner", "value"=>"Partner"}, "Existing Customer"=> {"name"=>"Existing Customer", "value"=>"Existing Customer"}, "Public Relations"=> {"name"=>"Public Relations", "value"=>"Public Relations"}, "Trade Show"=>{"name"=>"Trade Show", "value"=>"Trade Show"}, "Self Generated"=>{"name"=>"Self Generated", "value"=>"Self Generated"}, "Other"=>{"name"=>"Other", "value"=>"Other"}, "Direct Mail"=>{"name"=>"Direct Mail", "value"=>"Direct Mail"}, "Employee"=>{"name"=>"Employee", "value"=>"Employee"}, "Email"=>{"name"=>"Email", "value"=>"Email"}, "Web Site"=>{"name"=>"Web Site", "value"=>"Web Site"}, "Cold Call"=>{"name"=>"Cold Call", "value"=>"Cold Call"}, "Campaign"=>{"name"=>"Campaign", "value"=>"Campaign"}, "Conference"=>{"name"=>"Conference", "value"=>"Conference"}}}, "full_name"=> {"required"=>0, "label"=>"Name:", "name"=>"full_name", "type"=>"fullname", "options"=>[]}, "primary_address_country"=> {"required"=>0, "label"=>"Primary Address Country:", "name"=>"primary_address_country", "type"=>"varchar", "options"=>[]}, "primary_address_street"=> {"required"=>0, "label"=>"Primary Address Street:", "name"=>"primary_address_street", "type"=>"varchar", "options"=>[]}, "primary_address_postalcode"=> {"required"=>0, "label"=>"Primary Address Postal Code:", "name"=>"primary_address_postalcode", "type"=>"varchar", "options"=>[]}, "alt_address_street"=> {"required"=>0, "label"=>"Alternate Address Street:", "name"=>"alt_address_street", "type"=>"varchar", "options"=>[]}, "phone_work"=> {"required"=>0, "label"=>"Office Phone:", "name"=>"phone_work", "type"=>"phone", "options"=>[]}, "id"=> {"required"=>1, "label"=>"ID:", "name"=>"id", "type"=>"id", "options"=>[]}, "campaign_id"=> {"required"=>0, "label"=>"Campaign ID", "name"=>"campaign_id", "type"=>"id", "options"=>[]}}, "module_name"=>"Contacts", "link_fields"=> {"email_addresses"=> {"name"=>"email_addresses", "module"=>"EmailAddress", "bean_name"=>"EmailAddress", "relationship"=>"contacts_email_addresses", "type"=>"link"}, "quotes"=> {"name"=>"quotes", "module"=>"Quotes", "bean_name"=>"Quote", "relationship"=>"quotes_contacts_shipto", "type"=>"link"}, "leads"=> {"name"=>"leads", "module"=>"", "bean_name"=>"", "relationship"=>"contact_leads", "type"=>"link"}, "sid1_contact_types_contacts"=> {"name"=>"sid1_contact_types_contacts", "module"=>"", "bean_name"=>"", "relationship"=>"sid1_contact_types_contacts", "type"=>"link"}, "prospect_lists"=> {"name"=>"prospect_lists", "module"=>"ProspectLists", "bean_name"=>"", "relationship"=>"prospect_list_contacts", "type"=>"link"}, "direct_reports"=> {"name"=>"direct_reports", "module"=>"", "bean_name"=>"", "relationship"=>"contact_direct_reports", "type"=>"link"}, "teams"=> {"name"=>"teams", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_teams", "type"=>"link"}, "notes"=> {"name"=>"notes", "module"=>"", "bean_name"=>"", "relationship"=>"contact_notes", "type"=>"link"}, "contracts"=> {"name"=>"contracts", "module"=>"", "bean_name"=>"", "relationship"=>"contracts_quotes", "type"=>"link"}, "cases"=> {"name"=>"cases", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_cases", "type"=>"link"}, "team_count_link"=> {"name"=>"team_count_link", "module"=>"Teams", "bean_name"=>"TeamSet", "relationship"=>"contacts_team_count_relationship", "type"=>"link"}, "sid1_contaba27ct_type_ida"=> {"name"=>"sid1_contaba27ct_type_ida", "module"=>"", "bean_name"=>"", "relationship"=>"sid1_contact_type_contacts", "type"=>"link"}, "campaign_contacts"=> {"name"=>"campaign_contacts", "module"=>"", "bean_name"=>"", "relationship"=>"campaign_contacts", "type"=>"link"}, "meetings"=> {"name"=>"meetings", "module"=>"", "bean_name"=>"", "relationship"=>"meetings_contacts", "type"=>"link"}, "modified_user_link"=> {"name"=>"modified_user_link", "module"=>"Users", "bean_name"=>"User", "relationship"=>"contacts_modified_user", "type"=>"link"}, "created_by_link"=> {"name"=>"created_by_link", "module"=>"Users", "bean_name"=>"User", "relationship"=>"contacts_created_by", "type"=>"link"}, "campaigns"=> {"name"=>"campaigns", "module"=>"CampaignLog", "bean_name"=>"CampaignLog", "relationship"=>"contact_campaign_log", "type"=>"link"}, "tasks"=> {"name"=>"tasks", "module"=>"", "bean_name"=>"", "relationship"=>"contact_tasks", "type"=>"link"}, "project"=> {"name"=>"project", "module"=>"", "bean_name"=>"", "relationship"=>"projects_contacts", "type"=>"link"}, "products"=> {"name"=>"products", "module"=>"", "bean_name"=>"", "relationship"=>"contact_products", "type"=>"link"}, "accounts"=> {"name"=>"accounts", "module"=>"", "bean_name"=>"", "relationship"=>"accounts_contacts", "type"=>"link"}, "email_addresses_primary"=> {"name"=>"email_addresses_primary", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_email_addresses_primary", "type"=>"link"}, "emails"=> {"name"=>"emails", "module"=>"", "bean_name"=>"", "relationship"=>"emails_contacts_rel", "type"=>"link"}, "sid1_conta8312t_types_ida"=> {"name"=>"sid1_conta8312t_types_ida", "module"=>"", "bean_name"=>"", "relationship"=>"sid1_contact_types_contacts", "type"=>"link"}, "users"=> {"name"=>"users", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_users", "type"=>"link"}, "opportunities"=> {"name"=>"opportunities", "module"=>"Opportunities", "bean_name"=>"Opportunity", "relationship"=>"opportunities_contacts", "type"=>"link"}, "team_link"=> {"name"=>"team_link", "module"=>"Teams", "bean_name"=>"Team", "relationship"=>"contacts_team", "type"=>"link"}, "sid1_contact_type_contacts"=> {"name"=>"sid1_contact_type_contacts", "module"=>"", "bean_name"=>"", "relationship"=>"sid1_contact_type_contacts", "type"=>"link"}, "tasks_parent"=> {"name"=>"tasks_parent", "module"=>"", "bean_name"=>"", "relationship"=>"contact_tasks_parent", "type"=>"link"}, "bugs"=> {"name"=>"bugs", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_bugs", "type"=>"link"}, "assigned_user_link"=> {"name"=>"assigned_user_link", "module"=>"Users", "bean_name"=>"User", "relationship"=>"contacts_assigned_user", "type"=>"link"}, "contacts_sid1_contact_types"=> {"name"=>"contacts_sid1_contact_types", "module"=>"", "bean_name"=>"", "relationship"=>"contacts_sid1_contact_types", "type"=>"link"}, "calls"=> {"name"=>"calls", "module"=>"", "bean_name"=>"", "relationship"=>"calls_contacts", "type"=>"link"}, "reports_to_link"=> {"name"=>"reports_to_link", "module"=>"", "bean_name"=>"", "relationship"=>"contact_direct_reports", "type"=>"link"}}}

get_entry_list: Request: { "session": "9qdsuriq4c2sgo1sur53bhllp0", "module_name": "Contacts", "query": "", "order_by": "id", "offset": "", "select_fields": ["assigned_user_id","assistant_phone","phone_home","portal_password","date_modified","alt_address_postalcode","accept_status_id","team_set_id","picture","description","email1","title","primary_address_city","assigned_user_name","alt_address_state","reports_to_id","email2","report_to_name","portal_password1","primary_address_state","department","assistant","sync_contact","email_and_name1","team_name","accept_status_name","phone_mobile","portal_name","sid1_contact_type_contacts_name","c_accept_status_fields","account_name","portal_active","phone_other","alt_address_country","modified_by_name","last_name","alt_address_city","account_id","name","do_not_call","date_entered","team_count","m_accept_status_fields","birthdate","created_by_name","phone_fax","alt_address_street_2","campaign_name","deleted","salutation","alt_address_street_3","primary_address_street_2","invalid_email","primary_address_street_3","email_opt_out","modified_user_id","created_by","sid1_contact_types_contacts_name","first_name","portal_app","opportunity_role_fields","team_id","opportunity_role_id","opportunity_role","full_name","lead_source","primary_address_country","primary_address_postalcode","primary_address_street","alt_address_street","phone_work","id","campaign_id"], "link_name_to_fields_array": [], "max_results": "1", "deleted": 0 }

get_entry_list: JSON Response: {"entry_list"=> [{"name_value_list"=> {"primary_address_street"=> {"name"=>"primary_address_street", "value"=>"321 University Ave."}, "primary_address_postalcode"=> {"name"=>"primary_address_postalcode", "value"=>"69623"}, "modified_user_name"=> {"name"=>"modified_user_name", "value"=>"Sugar Administrator"}, "primary_address_state"=> {"name"=>"primary_address_state", "value"=>"CA"}, "primary_address_city"=> {"name"=>"primary_address_city", "value"=>"Kansas City"}, "sid1_contact_types_contacts_name"=> {"name"=>"sid1_contact_types_contacts_name", "value"=>""}, "birthdate"=>{"name"=>"birthdate", "value"=>false}, "phone_other"=>{"name"=>"phone_other", "value"=>""}, "c_accept_status_fields"=> {"name"=>"c_accept_status_fields", "value"=> " "}, "title"=>{"name"=>"title", "value"=>"VIP Operations"}, "campaign_id"=>{"name"=>"campaign_id", "value"=>""}, "primary_address_country"=> {"name"=>"primary_address_country", "value"=>"USA"}, "phone_fax"=>{"name"=>"phone_fax", "value"=>""}, "m_accept_status_fields"=> {"name"=>"m_accept_status_fields", "value"=> " "}, "alt_address_postalcode"=> {"name"=>"alt_address_postalcode", "value"=>""}, "opportunity_role_fields"=> {"name"=>"opportunity_role_fields", "value"=> " "}, "salutation"=>{"name"=>"salutation", "value"=>""}, "account_id"=> {"name"=>"account_id", "value"=>"a05fd10c-43fa-50cc-06e8-4d457eff371c"}, "report_to_name"=>{"name"=>"report_to_name", "value"=>""}, "date_modified"=> {"name"=>"date_modified", "value"=>"2011-01-31 19:52:32"}, "id"=>{"name"=>"id", "value"=>"111d8e29-9def-52ae-22b6-4d457e2bfc87"}, "portal_app"=>{"name"=>"portal_app", "value"=>""}, "created_by"=>{"name"=>"created_by", "value"=>"1"}, "modified_user_id"=>{"name"=>"modified_user_id", "value"=>"1"}, "deleted"=>{"name"=>"deleted", "value"=>"0"}, "alt_address_city"=>{"name"=>"alt_address_city", "value"=>""}, "portal_active"=>{"name"=>"portal_active", "value"=>"0"}, "email1"=>{"name"=>"email1", "value"=>"the.kid.kid@example.co.uk"}, "phone_home"=>{"name"=>"phone_home", "value"=>"(007) 125-2366"}, "phone_work"=>{"name"=>"phone_work", "value"=>"(061) 691-6482"}, "campaign_name"=>{"name"=>"campaign_name", "value"=>""}, "sid1_contact_type_contacts_name"=> {"name"=>"sid1_contact_type_contacts_name", "value"=>""}, "team_name"=>{"name"=>"team_name", "value"=>"West "}, "email2"=>{"name"=>"email2", "value"=>"the67@example.de"}, "team_set_id"=>{"name"=>"team_set_id", "value"=>"West"}, "assistant_phone"=>{"name"=>"assistant_phone", "value"=>""}, "created_by_name"=> {"name"=>"created_by_name", "value"=>"Sugar Administrator"}, "last_name"=>{"name"=>"last_name", "value"=>"Kanode"}, "reports_to_id"=>{"name"=>"reports_to_id", "value"=>""}, "alt_address_state"=>{"name"=>"alt_address_state", "value"=>""}, "portal_password"=>{"name"=>"portal_password", "value"=>""}, "modified_by_name"=> {"name"=>"modified_by_name", "value"=>"Sugar Administrator"}, "assigned_user_name"=> {"name"=>"assigned_user_name", "value"=>"Sarah Smith"}, "alt_address_street"=>{"name"=>"alt_address_street", "value"=>""}, "team_count"=>{"name"=>"team_count", "value"=>"1"}, "date_entered"=>{"name"=>"date_entered", "value"=>"2011-01-30 15:08:32"}, "description"=>{"name"=>"description", "value"=>""}, "assigned_user_id"=> {"name"=>"assigned_user_id", "value"=>"seed_sarah_id"}, "team_id"=>{"name"=>"team_id", "value"=>"West"}, "account_name"=>{"name"=>"account_name", "value"=>"P Piper & Sons"}, "department"=>{"name"=>"department", "value"=>""}, "lead_source"=>{"name"=>"lead_source", "value"=>"Cold Call"}, "first_name"=>{"name"=>"first_name", "value"=>"Tyron"}, "do_not_call"=>{"name"=>"do_not_call", "value"=>"0"}, "alt_address_country"=>{"name"=>"alt_address_country", "value"=>""}, "portal_name"=>{"name"=>"portal_name", "value"=>""}, "phone_mobile"=>{"name"=>"phone_mobile", "value"=>"(446) 080-9011"}, "assistant"=>{"name"=>"assistant", "value"=>""}, "picture"=>{"name"=>"picture", "value"=>""}}, "id"=>"111d8e29-9def-52ae-22b6-4d457e2bfc87", "module_name"=>"Contacts"}], "next_offset"=>1, "result_count"=>1, "relationship_list"=>[]}

get_entry_list: Request: { "session": "9qdsuriq4c2sgo1sur53bhllp0", "module_name": "Contacts", "query": "", "order_by": "id", "offset": "11", "select_fields": ["assigned_user_id","assistant_phone","phone_home","portal_password","date_modified","alt_address_postalcode","accept_status_id","team_set_id","picture","description","email1","title","primary_address_city","assigned_user_name","alt_address_state","reports_to_id","email2","report_to_name","portal_password1","primary_address_state","department","assistant","sync_contact","email_and_name1","team_name","accept_status_name","phone_mobile","portal_name","sid1_contact_type_contacts_name","c_accept_status_fields","account_name","portal_active","phone_other","alt_address_country","modified_by_name","last_name","alt_address_city","account_id","name","do_not_call","date_entered","team_count","m_accept_status_fields","birthdate","created_by_name","phone_fax","alt_address_street_2","campaign_name","deleted","salutation","alt_address_street_3","primary_address_street_2","invalid_email","primary_address_street_3","email_opt_out","modified_user_id","created_by","sid1_contact_types_contacts_name","first_name","portal_app","opportunity_role_fields","team_id","opportunity_role_id","opportunity_role","full_name","lead_source","primary_address_country","primary_address_postalcode","primary_address_street","alt_address_street","phone_work","id","campaign_id"], "link_name_to_fields_array": [], "max_results": "5", "deleted": 0 }

get_entry_list: JSON Response: {"entry_list"=> [{"name_value_list"=> {"primary_address_street"=> {"name"=>"primary_address_street", "value"=>"345 Sugar Blvd."}, "primary_address_postalcode"=> {"name"=>"primary_address_postalcode", "value"=>"18454"}, "modified_user_name"=> {"name"=>"modified_user_name", "value"=>"Sugar Administrator"}, "primary_address_state"=> {"name"=>"primary_address_state", "value"=>"CA"}, "primary_address_city"=> {"name"=>"primary_address_city", "value"=>"Cupertino"}, "sid1_contact_types_contacts_name"=> {"name"=>"sid1_contact_types_contacts_name", "value"=>""}, "birthdate"=>{"name"=>"birthdate", "value"=>false}, "phone_other"=>{"name"=>"phone_other", "value"=>""}, "c_accept_status_fields"=> {"name"=>"c_accept_status_fields", "value"=> " "}, "title"=>{"name"=>"title", "value"=>"Director Operations"}, "campaign_id"=>{"name"=>"campaign_id", "value"=>""}, "primary_address_country"=> {"name"=>"primary_address_country", "value"=>"USA"}, "phone_fax"=>{"name"=>"phone_fax", "value"=>""}, "m_accept_status_fields"=> {"name"=>"m_accept_status_fields", "value"=> " "}, "alt_address_postalcode"=> {"name"=>"alt_address_postalcode", "value"=>""}, "opportunity_role_fields"=> {"name"=>"opportunity_role_fields", "value"=> " "}, "salutation"=>{"name"=>"salutation", "value"=>""}, "account_id"=> {"name"=>"account_id", "value"=>"7c61c321-0136-f87b-a3b3-4d457eb62c4d"}, "report_to_name"=>{"name"=>"report_to_name", "value"=>""}, "date_modified"=> {"name"=>"date_modified", "value"=>"2011-01-30 15:08:33"}, "id"=>{"name"=>"id", "value"=>"1da8a4f9-cd43-3b9c-a62a-4d457e65809b"}, "portal_app"=>{"name"=>"portal_app", "value"=>""}, "created_by"=>{"name"=>"created_by", "value"=>"1"}, "modified_user_id"=>{"name"=>"modified_user_id", "value"=>"1"}, "deleted"=>{"name"=>"deleted", "value"=>"0"}, "alt_address_city"=>{"name"=>"alt_address_city", "value"=>""}, "portal_active"=>{"name"=>"portal_active", "value"=>"0"}, "email1"=> {"name"=>"email1", "value"=>"support.phone.section@example.com"}, "phone_home"=>{"name"=>"phone_home", "value"=>"(766) 308-4395"}, "phone_work"=>{"name"=>"phone_work", "value"=>"(051) 824-6643"}, "campaign_name"=>{"name"=>"campaign_name", "value"=>""}, "sid1_contact_type_contacts_name"=> {"name"=>"sid1_contact_type_contacts_name", "value"=>""}, "team_name"=>{"name"=>"team_name", "value"=>"West "}, "email2"=>{"name"=>"email2", "value"=>"info.sales@example.info"}, "team_set_id"=>{"name"=>"team_set_id", "value"=>"West"}, "assistant_phone"=>{"name"=>"assistant_phone", "value"=>""}, "created_by_name"=> {"name"=>"created_by_name", "value"=>"Sugar Administrator"}, "last_name"=>{"name"=>"last_name", "value"=>"Brennen"}, "reports_to_id"=>{"name"=>"reports_to_id", "value"=>""}, "alt_address_state"=>{"name"=>"alt_address_state", "value"=>""}, "portal_password"=>{"name"=>"portal_password", "value"=>""}, "modified_by_name"=> {"name"=>"modified_by_name", "value"=>"Sugar Administrator"}, "assigned_user_name"=> {"name"=>"assigned_user_name", "value"=>"Sarah Smith"}, "alt_address_street"=>{"name"=>"alt_address_street", "value"=>""}, "team_count"=>{"name"=>"team_count", "value"=>"1"}, "date_entered"=>{"name"=>"date_entered", "value"=>"2011-01-30 15:08:33"}, "description"=>{"name"=>"description", "value"=>""}, "assigned_user_id"=> {"name"=>"assigned_user_id", "value"=>"seed_sarah_id"}, "team_id"=>{"name"=>"team_id", "value"=>"West"}, "account_name"=>{"name"=>"account_name", "value"=>"A.G. Parr PLC"}, "department"=>{"name"=>"department", "value"=>""}, "lead_source"=>{"name"=>"lead_source", "value"=>"Cold Call"}, "first_name"=>{"name"=>"first_name", "value"=>"Fredric"}, "do_not_call"=>{"name"=>"do_not_call", "value"=>"0"}, "alt_address_country"=>{"name"=>"alt_address_country", "value"=>""}, "portal_name"=>{"name"=>"portal_name", "value"=>""}, "phone_mobile"=>{"name"=>"phone_mobile", "value"=>"(462) 264-0346"}, "assistant"=>{"name"=>"assistant", "value"=>""}, "picture"=>{"name"=>"picture", "value"=>""}}, "id"=>"1da8a4f9-cd43-3b9c-a62a-4d457e65809b", "module_name"=>"Contacts"}, {"name_value_list"=> {"primary_address_street"=> {"name"=>"primary_address_street", "value"=>"67321 West Siam St."}, "primary_address_postalcode"=> {"name"=>"primary_address_postalcode", "value"=>"65367"}, "modified_user_name"=> {"name"=>"modified_user_name", "value"=>"Sugar Administrator"}, "primary_address_state"=> {"name"=>"primary_address_state", "value"=>"CA"}, "primary_address_city"=> {"name"=>"primary_address_city", "value"=>"Santa Monica"}, "sid1_contact_types_contacts_name"=> {"name"=>"sid1_contact_types_contacts_name", "value"=>""}, "birthdate"=>{"name"=>"birthdate", "value"=>false}, "phone_other"=>{"name"=>"phone_other", "value"=>""}, "c_accept_status_fields"=> {"name"=>"c_accept_status_fields", "value"=> " "}, "title"=>{"name"=>"title", "value"=>"President"}, "campaign_id"=>{"name"=>"campaign_id", "value"=>""}, "primary_address_country"=> {"name"=>"primary_address_country", "value"=>"USA"}, "phone_fax"=>{"name"=>"phone_fax", "value"=>""}, "m_accept_status_fields"=> {"name"=>"m_accept_status_fields", "value"=> " "}, "alt_address_postalcode"=> {"name"=>"alt_address_postalcode", "value"=>""}, "opportunity_role_fields"=> {"name"=>"opportunity_role_fields", "value"=> " "}, "salutation"=>{"name"=>"salutation", "value"=>""}, "account_id"=> {"name"=>"account_id", "value"=>"923bc4ac-15ab-08dd-62f5-4d457eeba124"}, "report_to_name"=>{"name"=>"report_to_name", "value"=>""}, "date_modified"=> {"name"=>"date_modified", "value"=>"2011-01-30 15:08:32"}, "id"=>{"name"=>"id", "value"=>"1eff7e55-45dc-b09e-f5e7-4d457ece6160"}, "portal_app"=>{"name"=>"portal_app", "value"=>""}, "created_by"=>{"name"=>"created_by", "value"=>"1"}, "modified_user_id"=>{"name"=>"modified_user_id", "value"=>"1"}, "deleted"=>{"name"=>"deleted", "value"=>"0"}, "alt_address_city"=>{"name"=>"alt_address_city", "value"=>""}, "portal_active"=>{"name"=>"portal_active", "value"=>"0"}, "email1"=>{"name"=>"email1", "value"=>"sugar.hr@example.it"}, "phone_home"=>{"name"=>"phone_home", "value"=>"(678) 890-8111"}, "phone_work"=>{"name"=>"phone_work", "value"=>"(322) 432-3778"}, "campaign_name"=>{"name"=>"campaign_name", "value"=>""}, "sid1_contact_type_contacts_name"=> {"name"=>"sid1_contact_type_contacts_name", "value"=>""}, "team_name"=>{"name"=>"team_name", "value"=>"West "}, "email2"=>{"name"=>"email2", "value"=>"info82@example.org"}, "team_set_id"=> {"name"=>"team_set_id", "value"=>"867406b1-2c32-bb1c-6e81-4d457e3fbdb4"}, "assistant_phone"=>{"name"=>"assistant_phone", "value"=>""}, "created_by_name"=> {"name"=>"created_by_name", "value"=>"Sugar Administrator"}, "last_name"=>{"name"=>"last_name", "value"=>"Forgey"}, "reports_to_id"=>{"name"=>"reports_to_id", "value"=>""}, "alt_address_state"=>{"name"=>"alt_address_state", "value"=>""}, "portal_password"=>{"name"=>"portal_password", "value"=>""}, "modified_by_name"=> {"name"=>"modified_by_name", "value"=>"Sugar Administrator"}, "assigned_user_name"=> {"name"=>"assigned_user_name", "value"=>"Sarah Smith"}, "alt_address_street"=>{"name"=>"alt_address_street", "value"=>""}, "team_count"=>{"name"=>"team_count", "value"=>"3"}, "date_entered"=>{"name"=>"date_entered", "value"=>"2011-01-30 15:08:32"}, "description"=>{"name"=>"description", "value"=>""}, "assigned_user_id"=> {"name"=>"assigned_user_id", "value"=>"seed_sarah_id"}, "team_id"=>{"name"=>"team_id", "value"=>"West"}, "account_name"=>{"name"=>"account_name", "value"=>"360 Vacations"}, "department"=>{"name"=>"department", "value"=>""}, "lead_source"=>{"name"=>"lead_source", "value"=>"Other"}, "first_name"=>{"name"=>"first_name", "value"=>"Jeannie"}, "do_not_call"=>{"name"=>"do_not_call", "value"=>"0"}, "alt_address_country"=>{"name"=>"alt_address_country", "value"=>""}, "portal_name"=>{"name"=>"portal_name", "value"=>""}, "phone_mobile"=>{"name"=>"phone_mobile", "value"=>"(812) 683-0007"}, "assistant"=>{"name"=>"assistant", "value"=>""}, "picture"=>{"name"=>"picture", "value"=>""}}, "id"=>"1eff7e55-45dc-b09e-f5e7-4d457ece6160", "module_name"=>"Contacts"}, {"name_value_list"=> {"primary_address_street"=> {"name"=>"primary_address_street", "value"=>"9 IBM Path"}, "primary_address_postalcode"=> {"name"=>"primary_address_postalcode", "value"=>"58808"}, "modified_user_name"=> {"name"=>"modified_user_name", "value"=>"Sugar Administrator"}, "primary_address_state"=> {"name"=>"primary_address_state", "value"=>"CA"}, "primary_address_city"=> {"name"=>"primary_address_city", "value"=>"Persistance"}, "sid1_contact_types_contacts_name"=> {"name"=>"sid1_contact_types_contacts_name", "value"=>""}, "birthdate"=>{"name"=>"birthdate", "value"=>false}, "phone_other"=>{"name"=>"phone_other", "value"=>""}, "c_accept_status_fields"=> {"name"=>"c_accept_status_fields", "value"=> " "}, "title"=>{"name"=>"title", "value"=>"Director Operations"}, "campaign_id"=>{"name"=>"campaign_id", "value"=>""}, "primary_address_country"=> {"name"=>"primary_address_country", "value"=>"USA"}, "phone_fax"=>{"name"=>"phone_fax", "value"=>""}, "m_accept_status_fields"=> {"name"=>"m_accept_status_fields", "value"=> " "}, "alt_address_postalcode"=> {"name"=>"alt_address_postalcode", "value"=>""}, "opportunity_role_fields"=> {"name"=>"opportunity_role_fields", "value"=> " "}, "salutation"=>{"name"=>"salutation", "value"=>""}, "account_id"=> {"name"=>"account_id", "value"=>"cc7e79c3-7fea-ac83-d546-4d457e6b7841"}, "report_to_name"=>{"name"=>"report_to_name", "value"=>""}, "date_modified"=> {"name"=>"date_modified", "value"=>"2011-01-30 15:08:30"}, "id"=>{"name"=>"id", "value"=>"201cba16-1ea5-9d50-21fd-4d457ea23076"}, "portal_app"=>{"name"=>"portal_app", "value"=>""}, "created_by"=>{"name"=>"created_by", "value"=>"1"}, "modified_user_id"=>{"name"=>"modified_user_id", "value"=>"1"}, "deleted"=>{"name"=>"deleted", "value"=>"0"}, "alt_address_city"=>{"name"=>"alt_address_city", "value"=>""}, "portal_active"=>{"name"=>"portal_active", "value"=>"0"}, "email1"=>{"name"=>"email1", "value"=>"support63@example.edu"}, "phone_home"=>{"name"=>"phone_home", "value"=>"(451) 161-1069"}, "phone_work"=>{"name"=>"phone_work", "value"=>"(243) 625-0053"}, "campaign_name"=>{"name"=>"campaign_name", "value"=>""}, "sid1_contact_type_contacts_name"=> {"name"=>"sid1_contact_type_contacts_name", "value"=>""}, "team_name"=>{"name"=>"team_name", "value"=>"West "}, "email2"=> {"name"=>"email2", "value"=>"beans.section.support@example.org"}, "team_set_id"=>{"name"=>"team_set_id", "value"=>"West"}, "assistant_phone"=>{"name"=>"assistant_phone", "value"=>""}, "created_by_name"=> {"name"=>"created_by_name", "value"=>"Sugar Administrator"}, "last_name"=>{"name"=>"last_name", "value"=>"Crumb"}, "reports_to_id"=>{"name"=>"reports_to_id", "value"=>""}, "alt_address_state"=>{"name"=>"alt_address_state", "value"=>""}, "portal_password"=>{"name"=>"portal_password", "value"=>""}, "modified_by_name"=> {"name"=>"modified_by_name", "value"=>"Sugar Administrator"}, "assigned_user_name"=> {"name"=>"assigned_user_name", "value"=>"Sally Bronsen"}, "alt_address_street"=>{"name"=>"alt_address_street", "value"=>""}, "team_count"=>{"name"=>"team_count", "value"=>"1"}, "date_entered"=>{"name"=>"date_entered", "value"=>"2011-01-30 15:08:30"}, "description"=>{"name"=>"description", "value"=>""}, "assigned_user_id"=> {"name"=>"assigned_user_id", "value"=>"seed_sally_id"}, "team_id"=>{"name"=>"team_id", "value"=>"West"}, "account_name"=>{"name"=>"account_name", "value"=>"B.H. Edwards Inc"}, "department"=>{"name"=>"department", "value"=>""}, "lead_source"=>{"name"=>"lead_source", "value"=>"Campaign"}, "first_name"=>{"name"=>"first_name", "value"=>"Rosalind"}, "do_not_call"=>{"name"=>"do_not_call", "value"=>"0"}, "alt_address_country"=>{"name"=>"alt_address_country", "value"=>""}, "portal_name"=>{"name"=>"portal_name", "value"=>""}, "phone_mobile"=>{"name"=>"phone_mobile", "value"=>"(852) 017-0839"}, "assistant"=>{"name"=>"assistant", "value"=>""}, "picture"=>{"name"=>"picture", "value"=>""}}, "id"=>"201cba16-1ea5-9d50-21fd-4d457ea23076", "module_name"=>"Contacts"}, {"name_value_list"=> {"primary_address_street"=> {"name"=>"primary_address_street", "value"=>"123 Anywhere Street"}, "primary_address_postalcode"=> {"name"=>"primary_address_postalcode", "value"=>"29211"}, "modified_user_name"=> {"name"=>"modified_user_name", "value"=>"Sugar Administrator"}, "primary_address_state"=> {"name"=>"primary_address_state", "value"=>"CA"}, "primary_address_city"=> {"name"=>"primary_address_city", "value"=>"St. Petersburg"}, "sid1_contact_types_contacts_name"=> {"name"=>"sid1_contact_types_contacts_name", "value"=>""}, "birthdate"=>{"name"=>"birthdate", "value"=>false}, "phone_other"=>{"name"=>"phone_other", "value"=>""}, "c_accept_status_fields"=> {"name"=>"c_accept_status_fields", "value"=> " "}, "title"=>{"name"=>"title", "value"=>"Senior Product Manager"}, "campaign_id"=>{"name"=>"campaign_id", "value"=>""}, "primary_address_country"=> {"name"=>"primary_address_country", "value"=>"USA"}, "phone_fax"=>{"name"=>"phone_fax", "value"=>""}, "m_accept_status_fields"=> {"name"=>"m_accept_status_fields", "value"=> " "}, "alt_address_postalcode"=> {"name"=>"alt_address_postalcode", "value"=>""}, "opportunity_role_fields"=> {"name"=>"opportunity_role_fields", "value"=> " "}, "salutation"=>{"name"=>"salutation", "value"=>""}, "account_id"=> {"name"=>"account_id", "value"=>"f20af19e-f218-3269-12d0-4d457e2a4b16"}, "report_to_name"=>{"name"=>"report_to_name", "value"=>""}, "date_modified"=> {"name"=>"date_modified", "value"=>"2011-01-30 15:08:33"}, "id"=>{"name"=>"id", "value"=>"2248009b-6851-44f5-0c5f-4d457ef8f53b"}, "portal_app"=>{"name"=>"portal_app", "value"=>""}, "created_by"=>{"name"=>"created_by", "value"=>"1"}, "modified_user_id"=>{"name"=>"modified_user_id", "value"=>"1"}, "deleted"=>{"name"=>"deleted", "value"=>"0"}, "alt_address_city"=>{"name"=>"alt_address_city", "value"=>""}, "portal_active"=>{"name"=>"portal_active", "value"=>"0"}, "email1"=>{"name"=>"email1", "value"=>"info.sugar@example.us"}, "phone_home"=>{"name"=>"phone_home", "value"=>"(252) 463-5816"}, "phone_work"=>{"name"=>"phone_work", "value"=>"(673) 931-8741"}, "campaign_name"=>{"name"=>"campaign_name", "value"=>""}, "sid1_contact_type_contacts_name"=> {"name"=>"sid1_contact_type_contacts_name", "value"=>""}, "team_name"=>{"name"=>"team_name", "value"=>"West "}, "email2"=>{"name"=>"email2", "value"=>"support63@example.us"}, "team_set_id"=> {"name"=>"team_set_id", "value"=>"867406b1-2c32-bb1c-6e81-4d457e3fbdb4"}, "assistant_phone"=>{"name"=>"assistant_phone", "value"=>""}, "created_by_name"=> {"name"=>"created_by_name", "value"=>"Sugar Administrator"}, "last_name"=>{"name"=>"last_name", "value"=>"Teed"}, "reports_to_id"=>{"name"=>"reports_to_id", "value"=>""}, "alt_address_state"=>{"name"=>"alt_address_state", "value"=>""}, "portal_password"=>{"name"=>"portal_password", "value"=>""}, "modified_by_name"=> {"name"=>"modified_by_name", "value"=>"Sugar Administrator"}, "assigned_user_name"=> {"name"=>"assigned_user_name", "value"=>"Sarah Smith"}, "alt_address_street"=>{"name"=>"alt_address_street", "value"=>""}, "team_count"=>{"name"=>"team_count", "value"=>"3"}, "date_entered"=>{"name"=>"date_entered", "value"=>"2011-01-30 15:08:33"}, "description"=>{"name"=>"description", "value"=>""}, "assigned_user_id"=> {"name"=>"assigned_user_id", "value"=>"seed_sarah_id"}, "team_id"=>{"name"=>"team_id", "value"=>"West"}, "account_name"=>{"name"=>"account_name", "value"=>"AB Drivers Limited"}, "department"=>{"name"=>"department", "value"=>""}, "lead_source"=>{"name"=>"lead_source", "value"=>"Cold Call"}, "first_name"=>{"name"=>"first_name", "value"=>"Jamar"}, "do_not_call"=>{"name"=>"do_not_call", "value"=>"0"}, "alt_address_country"=>{"name"=>"alt_address_country", "value"=>""}, "portal_name"=>{"name"=>"portal_name", "value"=>""}, "phone_mobile"=>{"name"=>"phone_mobile", "value"=>"(755) 306-4583"}, "assistant"=>{"name"=>"assistant", "value"=>""}, "picture"=>{"name"=>"picture", "value"=>""}}, "id"=>"2248009b-6851-44f5-0c5f-4d457ef8f53b", "module_name"=>"Contacts"}, {"name_value_list"=> {"primary_address_street"=> {"name"=>"primary_address_street", "value"=>"67321 West Siam St."}, "primary_address_postalcode"=> {"name"=>"primary_address_postalcode", "value"=>"11116"}, "modified_user_name"=> {"name"=>"modified_user_name", "value"=>"Sugar Administrator"}, "primary_address_state"=> {"name"=>"primary_address_state", "value"=>"CA"}, "primary_address_city"=> {"name"=>"primary_address_city", "value"=>"St. Petersburg"}, "sid1_contact_types_contacts_name"=> {"name"=>"sid1_contact_types_contacts_name", "value"=>""}, "birthdate"=>{"name"=>"birthdate", "value"=>false}, "phone_other"=>{"name"=>"phone_other", "value"=>""}, "c_accept_status_fields"=> {"name"=>"c_accept_status_fields", "value"=> " "}, "title"=>{"name"=>"title", "value"=>"Senior Product Manager"}, "campaign_id"=>{"name"=>"campaign_id", "value"=>""}, "primary_address_country"=> {"name"=>"primary_address_country", "value"=>"USA"}, "phone_fax"=>{"name"=>"phone_fax", "value"=>""}, "m_accept_status_fields"=> {"name"=>"m_accept_status_fields", "value"=> " "}, "alt_address_postalcode"=> {"name"=>"alt_address_postalcode", "value"=>""}, "opportunity_role_fields"=> {"name"=>"opportunity_role_fields", "value"=> " "}, "salutation"=>{"name"=>"salutation", "value"=>""}, "account_id"=> {"name"=>"account_id", "value"=>"7c61c321-0136-f87b-a3b3-4d457eb62c4d"}, "report_to_name"=>{"name"=>"report_to_name", "value"=>""}, "date_modified"=> {"name"=>"date_modified", "value"=>"2011-01-30 15:08:32"}, "id"=>{"name"=>"id", "value"=>"232b3f0c-65b5-ee68-cbaf-4d457e258089"}, "portal_app"=>{"name"=>"portal_app", "value"=>""}, "created_by"=>{"name"=>"created_by", "value"=>"1"}, "modified_user_id"=>{"name"=>"modified_user_id", "value"=>"1"}, "deleted"=>{"name"=>"deleted", "value"=>"0"}, "alt_address_city"=>{"name"=>"alt_address_city", "value"=>""}, "portal_active"=>{"name"=>"portal_active", "value"=>"0"}, "email1"=>{"name"=>"email1", "value"=>"sales.the@example.name"}, "phone_home"=>{"name"=>"phone_home", "value"=>"(336) 471-9385"}, "phone_work"=>{"name"=>"phone_work", "value"=>"(426) 785-0180"}, "campaign_name"=>{"name"=>"campaign_name", "value"=>""}, "sid1_contact_type_contacts_name"=> {"name"=>"sid1_contact_type_contacts_name", "value"=>""}, "team_name"=>{"name"=>"team_name", "value"=>"West "}, "email2"=>{"name"=>"email2", "value"=>"sugar33@example.com"}, "team_set_id"=>{"name"=>"team_set_id", "value"=>"West"}, "assistant_phone"=>{"name"=>"assistant_phone", "value"=>""}, "created_by_name"=> {"name"=>"created_by_name", "value"=>"Sugar Administrator"}, "last_name"=>{"name"=>"last_name", "value"=>"Frates"}, "reports_to_id"=>{"name"=>"reports_to_id", "value"=>""}, "alt_address_state"=>{"name"=>"alt_address_state", "value"=>""}, "portal_password"=>{"name"=>"portal_password", "value"=>""}, "modified_by_name"=> {"name"=>"modified_by_name", "value"=>"Sugar Administrator"}, "assigned_user_name"=> {"name"=>"assigned_user_name", "value"=>"Sarah Smith"}, "alt_address_street"=>{"name"=>"alt_address_street", "value"=>""}, "team_count"=>{"name"=>"team_count", "value"=>"1"}, "date_entered"=>{"name"=>"date_entered", "value"=>"2011-01-30 15:08:32"}, "description"=>{"name"=>"description", "value"=>""}, "assigned_user_id"=> {"name"=>"assigned_user_id", "value"=>"seed_sarah_id"}, "team_id"=>{"name"=>"team_id", "value"=>"West"}, "account_name"=>{"name"=>"account_name", "value"=>"A.G. Parr PLC"}, "department"=>{"name"=>"department", "value"=>""}, "lead_source"=>{"name"=>"lead_source", "value"=>"Email"}, "first_name"=>{"name"=>"first_name", "value"=>"Duane"}, "do_not_call"=>{"name"=>"do_not_call", "value"=>"0"}, "alt_address_country"=>{"name"=>"alt_address_country", "value"=>""}, "portal_name"=>{"name"=>"portal_name", "value"=>""}, "phone_mobile"=>{"name"=>"phone_mobile", "value"=>"(146) 857-4958"}, "assistant"=>{"name"=>"assistant", "value"=>""}, "picture"=>{"name"=>"picture", "value"=>""}}, "id"=>"232b3f0c-65b5-ee68-cbaf-4d457e258089", "module_name"=>"Contacts"}], "next_offset"=>16, "result_count"=>5, "relationship_list"=>[]}

get_module_fields: Request: { "session": "9qdsuriq4c2sgo1sur53bhllp0", "module_name": "Opportunities" }

get_module_fields: JSON Response: {"module_fields"=> {"name"=> {"required"=>1, "label"=>"Opportunity Name:", "name"=>"name", "type"=>"name", "options"=>[]}, "currency_id"=> {"required"=>0, "label"=>"Currency:", "name"=>"currency_id", "type"=>"id", "options"=>[]}, "campaign_id"=> {"required"=>0, "label"=>"campaign_id", "name"=>"campaign_id", "type"=>"id", "options"=>[]}, "sales_stage"=> {"required"=>1, "label"=>"Sales Stage:", "name"=>"sales_stage", "type"=>"enum", "options"=> {"Value Proposition"=> {"name"=>"Value Proposition", "value"=>"Value Proposition"}, "Needs Analysis"=>{"name"=>"Needs Analysis", "value"=>"Needs Analysis"}, "Proposal/Price Quote"=> {"name"=>"Proposal/Price Quote", "value"=>"Proposal/Price Quote"}, "Closed Lost"=>{"name"=>"Closed Lost", "value"=>"Closed Lost"}, "Closed Won"=>{"name"=>"Closed Won", "value"=>"Closed Won"}, "Prospecting"=>{"name"=>"Prospecting", "value"=>"Prospecting"}, "Perception Analysis"=> {"name"=>"Perception Analysis", "value"=>"Perception Analysis"}, "Negotiation/Review"=> {"name"=>"Negotiation/Review", "value"=>"Negotiation/Review"}, "Qualification"=>{"name"=>"Qualification", "value"=>"Qualification"}, "Id. Decision Makers"=> {"name"=>"Id. Decision Makers", "value"=>"Id. Decision Makers"}}}, "amount"=> {"required"=>1, "label"=>"Opportunity Amount:", "name"=>"amount", "type"=>"currency", "options"=>[]}, "account_id"=> {"required"=>0, "label"=>"Account ID", "name"=>"account_id", "type"=>"id", "options"=>[]}, "date_modified"=> {"required"=>0, "label"=>"Date Modified", "name"=>"date_modified", "type"=>"datetime", "options"=>[]}, "deleted"=> {"required"=>0, "label"=>"Deleted", "name"=>"deleted", "default_value"=>"0", "type"=>"bool", "options"=>[]}, "created_by"=> {"required"=>0, "label"=>"Created By", "name"=>"created_by", "type"=>"assigned_user_name", "options"=>[]}, "modified_user_id"=> {"required"=>0, "label"=>"Modified By", "name"=>"modified_user_id", "type"=>"assigned_user_name", "options"=>[]}, "id"=> {"required"=>1, "label"=>"ID", "name"=>"id", "type"=>"id", "options"=>[]}, "next_step"=> {"required"=>0, "label"=>"Next Step:", "name"=>"next_step", "type"=>"varchar", "options"=>[]}, "campaign_name"=> {"required"=>0, "label"=>"Campaign:", "name"=>"campaign_name", "type"=>"relate", "options"=>[]}, "team_name"=> {"required"=>0, "label"=>"Teams", "name"=>"team_name", "type"=>"relate", "options"=>[]}, "team_set_id"=> {"required"=>0, "label"=>"Team Set ID", "name"=>"team_set_id", "type"=>"id", "options"=>[]}, "created_by_name"=> {"required"=>0, "label"=>"Created By", "name"=>"created_by_name", "type"=>"assigned_user_name", "options"=>[]}, "currency_name"=> {"required"=>0, "label"=>"Currency Name", "name"=>"currency_name", "type"=>"relate", "options"=>[]}, "assigned_user_name"=> {"required"=>0, "label"=>"Assigned to:", "name"=>"assigned_user_name", "type"=>"relate", "options"=>[]}, "modified_by_name"=> {"required"=>0, "label"=>"Modified By", "name"=>"modified_by_name", "type"=>"assigned_user_name", "options"=>[]}, "currency_symbol"=> {"required"=>0, "label"=>"Currency Symbol", "name"=>"currency_symbol", "type"=>"relate", "options"=>[]}, "opportunity_type"=> {"required"=>0, "label"=>"Type:", "name"=>"opportunity_type", "type"=>"enum", "options"=> {"New Business"=>{"name"=>"New Business", "value"=>"New Business"}, ""=>{"name"=>"", "value"=>""}, "Existing Business"=> {"name"=>"Existing Business", "value"=>"Existing Business"}}}, "team_count"=> {"required"=>0, "label"=>"Teams", "name"=>"team_count", "type"=>"relate", "options"=>[]}, "assigned_user_id"=> {"required"=>0, "label"=>"Assigned User:", "name"=>"assigned_user_id", "type"=

frugardc commented 13 years ago

Looks like GitHub chops the end off of the output. Is there a way to attach a file?

frugardc commented 13 years ago

I posted the two logs in a Gist. Hopefully that helps...

https://gist.github.com/805877

davidsulc commented 13 years ago

This is interesting. Can you post the output of

contact.associations
contact_type.associations
opportunity.associations

Can you also post the output of contact.associate!(contact_type) ?

frugardc commented 13 years ago

====== Contact

[, , , , contacts_sid1_contact_types, , , , , , campaign_contacts, , , , , , , , , , sid1_contact_types_contacts, , , , , , , , , , , , , , , , sid1_contact_type_contacts, ] ====== Contact Type

[, , opportunities_sid1_contact_types, , , , , , contacts_sid1_contact_types, , , ] ====== Opportunity

[, , campaign_opportunities, , , , , , , , , , , , , , , , , opportunities_sid1_contact_type, , , , opportunities_sid1_contact_types, , ]

frugardc commented 13 years ago

and for contact.associate

Associating Contacts calling set_relationship(sid1_contact_types, 24216b01-48f4-e38d-f79c-4d4819a35851, contacts_sid1_contact_types, 111d8e29-9def-52ae-22b6-4d457e2bfc87, ) set_relationship: Request: { "session": "qqoal19hgn6f854n0qmha3v4a1", "module_name": "sid1_contact_types", "module_id": "24216b01-48f4-e38d-f79c-4d4819a35851", "link_field_name": "contacts_sid1_contact_types", "related_ids": ["111d8e29-9def-52ae-22b6-4d457e2bfc87"], "name_value_list": [], "delete": 0
}

set_relationship: JSON Response: {"failed"=>0, "deleted"=>0, "created"=>1}

davidsulc commented 13 years ago

It seems you called contact_type.associate in the last example. Can you check? It looks like 111d8e29-9def-52ae-22b6-4d457e2bfc87 is a contact and (I assume) 24216b01-48f4-e38d-f79c-4d4819a35851 is a ContactType.

frugardc commented 13 years ago

Got it.

Associating Contacts calling set_relationship(Contacts, 111d8e29-9def-52ae-22b6-4d457e2bfc87, sid1_contact_type_contacts, 68edacd7-4af1-aa08-d475-4d483613e00b, ) set_relationship: Request: { "session": "2pin32t7s1uk9p82ju1fnj5ko6", "module_name": "Contacts", "module_id": "111d8e29-9def-52ae-22b6-4d457e2bfc87", "link_field_name": "sid1_contact_type_contacts", "related_ids": ["68edacd7-4af1-aa08-d475-4d483613e00b"], "name_value_list": [], "delete": 0
}

set_relationship: JSON Response: {"failed"=>1, "deleted"=>0, "created"=>0}

davidsulc commented 13 years ago

Ok. I think I know what's going on, and I think it's (mostly) Sugar's fault.

As I recall, you've deleted and recreated this relationship, and noticed that the relationship hadn't been deleted properly.

Here's my analysis of the problem: the real link_fields are sid1_contact_types_contacts and opportunities_sid1_contact_types. However, sid1_contact_type_contacts and opportunities_sid1_contact_type are being picked up by the gem (notice the absence of 's').

The reason the relationship is created correctly from the ContactType side is because it doesn't have wrong link_fields (perhaps they were deleted correctly).

Can you try a clean install of Sugar and create a ContactType with the appropriate relationship and test it out? This should tell us whether I'm on the right track or not.

frugardc commented 13 years ago

I can probably do so this afternoon.

So you think it's the fact that the relationships are still duplicated, and the order in which they are returned is not guaranteed, so it would work when the correct relationship is returned first, and not other times, when the incorrect relationship is returned first.

davidsulc commented 13 years ago

Yes, that's my best guess. To find the link field for an association, we basically do "find a link field with both module names". To the best of my knowledge, there's no clean way we could determine which is the correct link_field.

I'm also not sure you're able to create multiple (different) relationships between 2 same modules in the Studio, so it seems it's an error.

davidsulc commented 13 years ago

Also, please make sure you try it with the HEAD branch.

chicks commented 13 years ago

From what I recall, Studio will happily let you create duplicate relationships between modules.

davidsulc commented 13 years ago

That is double plus uncool. I checked it out and you're right: Studio simply appends a _1 to the link_field name and moves on to better things.

This is where it will become a MAJOR issue in the gem: although you can specify a label name in the Studio (to differentiate the subpanels inthe GUI), that label name isn't returned on the API call.

In other words, if I create 2 links between contacts and documents (e.g. "legal agreements" and "family pictures") it won't be possible to have a sexy way to use those relationships (e.g. contact.family_pictures). And contact.associate!(document) could add to family pictures or legal agreements...

frugardc commented 13 years ago

You see any of the same issues with removing a relationship and re-adding it?

chicks commented 13 years ago

I checked with Engineering - the reason you can create duplicate relationships is to support situations like:

Account -> Companies (Field Name: Reseller) Account -> Companies (Field Name: Customer)

That being said, this breaks REST compatibility. You could modify the link_field to be more specific if needed.

davidsulc commented 13 years ago

The problem is that (as far as I can tell) the field name info isn't returned on the REST call, so we can't differentiate the two relationships...

chicks commented 13 years ago

Err, modifying the link_field wouldn't really help because we infer the module names from the link_field.

chicks commented 13 years ago

Ohhhh so if you create two relationships between the same modules, the link_field output from get_module_fields only contains one of the two relationships?

davidsulc commented 13 years ago

I was thinking that if we had access to the labels, we could register methods with that label name (or something based on it) and give access to both relationships between 2 modules. E.g. (using your example above) you could call both account.resellers and account.customers. Internally, we would match up the relationship's label (used as the method name) back to the appropriate link_field (i.e. account_companies or account_companies_1).

chicks commented 13 years ago

This sounds like a feasible solution. I'll see if I can get it working.

davidsulc commented 13 years ago

Where are you going to get the relationship labels from? Did I miss something in the API?

chicks commented 13 years ago

Ahhh... You are right... I was thinking of the Labels on the get_module_fields output.

That being said, I'm pretty sure "name" is always unique. In Christian's example above, he has multiple relationships to "sid1_contact_type_contacts", but the name is either "sid1_contact_type_contacts", or "sid1_contaba27ct_type_ida".

I'm not sure what the _ida relationship represents, but if this is standard behavior of studio then I can probably figure out how to handle it gracefully.

chicks commented 13 years ago

Also, I think it's high time to build our Sugar module for testing relationships. This is getting too complex and critical to ignore :P

I'll see what I can cook up.

davidsulc commented 13 years ago

Yeah, we definitely need standardized testing on relationships and custom modules.

Watch out for the relationship names, though. As far as I can tell, Sugar creates a weird-looking name for some relationships (it seems like it replaces a letter with a 4 character alphanumerical string), but this is always in addition to the standard relationship name (that is some variation of the 2 modules' names). Perhaps it's for internal use? That's probably be a good question for one of the engineers...

The relationships themselves seem to be named sequentially, if multiple relationships are created between the same modules (and have the same cardinality).

In Christian's case, they're not numbered sequentially because (I suspect) the cardinalities weren't the same (which would explain the 's' difference).

chicks commented 13 years ago

Yeah, the relationship names get aliased when they exceed a certain length. This is to work around issues (I think) with column name limits in Oracle.

I've been looking through the code, and its safe to assume the plurality also indicated cardinality on custom modules.

chicks commented 13 years ago

I did some refactorings to the underlying Association class. Can you see if this is still a problem?

chicks commented 13 years ago

Also, when you test can you enable debugging? I'm curious to see if any methods get overridden, and I added a message in for that.

chicks commented 13 years ago

Is this still an issue?

davidsulc commented 13 years ago

On a side note, we're still going to have issues with multiple relationships defined between 2 same modules (as discussed above). And as far as I can tell, the only workable way to fix that is having Sugar expose the relationship label on the REST API.

davidsulc commented 13 years ago

I'm closing this: I've documented it with https://github.com/chicks/sugarcrm/issues/43 and https://github.com/chicks/sugarcrm/issues/44

Both have been submitted to SugarCRM with issues 43340 and 43341.

FYI, you should be able to manually fix the issue by deleting the offending relationships in the vardefs for the appropriate module. E.g. the vardefs for the Contacts module are in custom/modules/Contacts/Ext/Vardefs/vardefs.ext.php